i want in my gridview following requirements ,
Code
s.no pointsName Employee IsOKCode
1 XXX(TEXTBOX) EMP1(DDL) TRUE(CHECKBOX)Code
2 YYY(TEXTBOX) EMP1(DDL) TRUE(CHECKBOXCode
3 zzz(TEXTBOX) EMP1(DDL) TRUE(CHECKBOXCode
Id NameCode
1 xxxCode
2 yyyCode
3 zzzHide Copy Code
Code
Id NameCode
1 xxxCode
2 yyyCode
3 zzzHide Expand
Copy Code
Copy CodeCode
DataTable dt = new DataTable();Code
DataRow dr = null;Code
var SecPoint = _service.GetAllDutyPoint().ToList();Code
foreach (var point in SecPoint)Code
{ for (int I = 1; I <= point.NoOfMinEmployes; I++)Code
{ ////Define the ColumnsCode
//dr["RowNumber"] = I + 1;Code
//dt.Columns.Add(new DataColumn("RowNumber", typeof(string)));Code
//dt.Columns.Add(new DataColumn("Column1", typeof(string)));Code
//dt.Columns.Add(new DataColumn("Column2", typeof(string)));Code
Code
//dt.Columns.Add(new DataColumn("Column3", typeof(string)));Code
//dr = dt.NewRow();Code
//dt.Rows.Add(dr);Code
////Store the DataTable in ViewStateCode
//ViewState["CurrentTable"] = dt;Code
////Bind the DataTable to the GridCode
//Gridview1.DataSource = dt;Code
//Gridview1.DataBind();Code
////Extract and Fill the DropDownList with DataCode
//TextBox txtbox = (TextBox)Gridview1.Rows[0].Cells[1].FindControl("TextBox12");Code
//DropDownList ddl1 = (DropDownList)Gridview1.Rows[0].Cells[2].FindControl("ddlEmp");Code
//TextBox txtbox1 = (TextBox)Gridview1.Rows[0].Cells[3].FindControl("TextBox13");Code
//DropDownList ddl2 = (DropDownList)Gridview1.Rows[0].Cells[4].FindControl("ddlEmp2");Code
//FillDropDownList(ddl1);Code
//FillDropDownList(ddl2); private void FillDropDownList(DropDownList ddl)Code
{ var emp1 = _service.GetEmployeeDutyByEmployee_Id(MyUser.Employee_Id).LastOrDefault();Code
var EmpList = _service.GetAllEmployeeDuty().OrderByDescending(x => x.EndDate).GroupBy(x => x.Employee_Id).Select(x => x.First()).ToList();Code
var empList = EmpList.Where(X=>X.ToSector_Id== emp1.ToSector_Id).ToList();Code
ddl.Bind(empList, "EmployeeIdName", "Employee_Id");Code
}Code
}

Answers
Know the answer? Post it. Somebody with the same question will find it here.