Click here to Skip to main content
15,868,420 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
i have a grid view with a coloumn ISEnabled now i want to edit a particular row and where i can edit the ISEnabled using Drop down .

I have a drop down in edit item temple .
can any one suggested with with this.
Posted

1 solution

U should try like that :
C#
protected void gvCheck_RowEditing(object sender, GridViewEditEventArgs e)
  {

 gvCheck.EditIndex = e.NewEditIndex;
        gvCheck.DataSource = ViewState["YourViewstateName OR Session"] as DataTable;//For binding your grid.
        gvCheck.DataBind();
        DropDownList ddlTest = (DropDownList)gvCheck.Rows[e.NewEditIndex].FindControl("ddlTest");
        ddlTest.DataSource = ViewState["YourViewstateName OR Session"] as DataTable;// For binding your dropdown 
        ddlTest.DataTextField = "Name";
        ddlTest.DataValueField = "Name";
        ddlTest.DataBind();
        ddlTest.Items.Insert(0, new ListItem("Select", "0"));

}
 
Share this answer
 
Comments
Gopinath_Rajan 1-Oct-12 5:59am    
you have any buttons on the same row
tamilarasanm 29-Oct-13 3:39am    
aasdasd

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