Click here to Skip to main content
15,900,511 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have a dropdownlist in webform,my requirement are followings
1.there are three column label pointname,Employee dropdownlist,and checkbox
2.when Employee is selected from list it will remove employee through selected index change.
3.when employee is removed i want that dropdownlist updated, each time when employee is removed?
these are two code snippet
C#
protected void OnRowDataBound(object sender, GridViewRowEventArgs e)
       {
           if (e.Row.RowType == DataControlRowType.DataRow)
           {

               CheckBox CHKBOX = (e.Row.FindControl("Released") as CheckBox);
               CheckBox CHKBOX1 = (e.Row.FindControl("Released1") as CheckBox);
               DropDownList ddlEmployee = (e.Row.FindControl("ddlEmp") as DropDownList);
               DropDownList ddlEmployee2 = (e.Row.FindControl("ddlEmp2") as DropDownList);
               var Emplist1 = _service.GetAllSectorEmployee();
               var lastrecord = _service.GetAllDailyManualRoaster().LastOrDefault(x => x.ManDailyRoasterDate == DateTime.Now.Date);
               var lastrecord2 = _service.GetAllDailyManualRoaster().LastOrDefault(x => x.ManDailyRoasterDate == DateTime.Now.Date);
               ddlEmployee.Bind(Emplist1, "EmployeeIdName", "Employee_Id");
               ddlEmployee2.Bind(Emplist1, "EmployeeIdName", "Employee_Id");

           }
       }
  private void BindGrid()
       {
           Entities entities = new Entities();


           Gridview1.DataSource = (from customer in entities.SectorWisePoints
                                  join se in entities.SectorEmployees on customer.Sector_Id equals se.Sector_Id
                                  select new
                                  {

                                      customer.Name

                                  }).ToList();

           Gridview1.DataBind();


       }
Posted
Comments
Naveen.Sanagasetti 1-Oct-15 6:25am    
Now, What is your need..?
Sajid227 2-Oct-15 1:04am    
i want that each time when employee is removed from the list ,remaining dropdownlist is updated ,showing those employee whose are not assinge yet like
pointname Employee pointname Employee
xxx 5 yyy 4
fff 3 mmm 2
sss 1
Sinisa Hajnal 2-Oct-15 5:12am    
Just reload the grid.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900