i have go through many article in google,but its not up to my point,
i want in my gridview following requirements ,
Code
s.no    pointsName     Employee   IsOK
Code
 1 XXX(TEXTBOX)     EMP1(DDL)  TRUE(CHECKBOX)
Code
 2        YYY(TEXTBOX)     EMP1(DDL)  TRUE(CHECKBOX
Code
 3         zzz(TEXTBOX)     EMP1(DDL)  TRUE(CHECKBOX
IN my database table Dutypoint
Code
Id    Name
Code
 1     xxx
Code
2     yyy
Code
3     zzz
IN my database table Employee
Hide Copy Code
Code
Id    Name
Code
1     xxx
Code
 2     yyy
Code
 3     zzz
i want to create rows in gridview base on point,and display name of point in the text box.what i so far tried is as follow
Hide Expand Copy Code
Code
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 Columns
Code
        //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 ViewState
Code
             //ViewState["CurrentTable"] = dt;
Code
               ////Bind the DataTable to the Grid
Code
               //Gridview1.DataSource = dt;
Code
        //Gridview1.DataBind();
Code
    ////Extract and Fill the DropDownList with Data
Code
           //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
   }
its just return one row