protected void Page_Load(object sender, EventArgs e) { departments = new Dictionary <int, string>(); DataView departmentDv = (DataView)DepartmentDataSource.Select(DataSourceSelectArguments.Empty); for (int i = 0; i < departmentDv.Count; ++i) { departments.Add((int)departmentDv[i][0], (string)departmentDv[i][1]); } GridViewBindData(); }
protected void Page_Load(object sender, EventArgs e) { supervisors = new Dictionary <int, string>(); departments = new Dictionary <int, string>(); DataView supervisorDv = (DataView)SupervisorDataSource.Select(DataSourceSelectArguments.Empty); for (int i = 0; i < supervisorDv.Count; ++i) { supervisors.Add((int)supervisorDv[i][0], (string)supervisorDv[i][1]); } DataView departmentDv = (DataView)DepartmentDataSource.Select(DataSourceSelectArguments.Empty); for (int i = 0; i < departmentDv.Count; ++i) { departments.Add((int)departmentDv[i][0], (string)departmentDv[i][1]); } if (!IsPostBack) { GridViewBindAllEmployee(); } }