private void BindDeptDdl() { List <Department> deptList = DisbursementLogic.GetListofDepartments(); DdlDept.DataSource = deptList; DdlDept.DataBind(); DdlDept.SelectedIndex = 0; }
private void LoadDepartment() { DdlDept.DataSource = objBll.GetJob("spGetDept", null); DdlDept.DataBind(); ListItem liPost1 = new ListItem("Select Department", "-1"); DdlDept.Items.Insert(0, liPost1); //ListItem liPost2 = new ListItem("All", "0"); //DdlDept.Items.Insert(1, liPost2); }
public void BindDeptDdl() { using (SqlCommand cmd = new SqlCommand("FetchAllDepartment", db.DbConnect())) { DdlDept.AppendDataBoundItems = true; DdlDept.DataSource = cmd.ExecuteReader(); DdlDept.DataTextField = "dept_name"; DdlDept.DataValueField = "dept_id"; DdlDept.DataBind(); } }
void BindControls() { List <Department> dList = DisbursementLogic.GetListofDepartments(); Department selectAll = new Department(); selectAll.DepartmentName = "All"; selectAll.DeptID = "All"; dList.Add(selectAll); DdlDept.DataSource = dList; DdlDept.DataBind(); DdlDept.SelectedIndex = dList.Count() - 1; }
public void PopulateCombos() { try { DdlEmpName.DataSource = emp.ShowEmp(); DdlEmpName.DataTextField = "Emp_FirstName"; DdlEmpName.DataValueField = "EmpId"; DdlEmpName.DataBind(); DdlEmpName.Items.Insert(0, "--Select Emp--"); DdlDept.DataSource = dept.ShowDepartment(); DdlDept.DataTextField = "DeptName"; DdlDept.DataValueField = "DepartmentId"; DdlDept.DataBind(); DdlDept.Items.Insert(0, "--Select Dept--"); } catch (Exception ex) { lblMsg.Text = ex.Message; } }
private void BindDdls() { List <Department> deptList = DisbursementLogic.GetListofDepartments(); Department allDept = new Department(); allDept.DepartmentName = "All"; allDept.DeptID = "All"; deptList.Add(allDept); DdlDept.DataSource = deptList; DdlDept.DataBind(); DdlDept.SelectedIndex = 0; List <CollectionPoint> colPointList = DisbursementLogic.GetListofColPoint(); CollectionPoint allColPoint = new CollectionPoint(); allColPoint.CollectionPointID = -1; allColPoint.CollectionPoint1 = "All"; colPointList.Add(allColPoint); DdlColPoint.DataSource = colPointList; DdlColPoint.DataBind(); DdlColPoint.SelectedIndex = 0; }