public void SelectDepartment() { List <BLLDepartmentDesignation> objlist = new List <BLLDepartmentDesignation>(); BLLDepartmentDesignation objbll = new BLLDepartmentDesignation(); objlist = objbll.SelectDepartment(); if (objlist.Count > 0) { dgdepartment.DataSource = objlist; //dgdepartment.Columns[3].Visible = false; dgdepartment.DataBind(); for (int i = 0; i <= dgdepartment.Rows.Count - 1; i++) { string update = (string)Session["update"]; string delete = (string)Session["delete"]; if (update == "yes") { dgdepartment.Rows[i].Cells[2].Enabled = true; } else { dgdepartment.Rows[i].Cells[2].Enabled = false; } if (delete == "yes") { dgdepartment.Rows[i].Cells[3].Enabled = true; } else { dgdepartment.Rows[i].Cells[3].Enabled = false; } } } }
public void SelectDepartment() { List <BLLDepartmentDesignation> objlist = new List <BLLDepartmentDesignation>(); BLLDepartmentDesignation objbll = new BLLDepartmentDesignation(); objlist = objbll.SelectDepartment(); if (objlist.Count > 0) { cmdDepartmants.DataSource = objlist; cmdDepartmants.ValueField = "dep_id"; cmdDepartmants.TextField = "dep_name"; cmdDepartmants.DataBind(); } }