How to Find Control RowEditing Event

Posted by Jayakumars under ASP.NET on 7/29/2013 | Points: 10 | Views : 11004 | Status : [Member] [MVP] | Replies : 1

I put gridview control and edit template when i edit in hyperlink in gridview
but did not find control in editemplate dropdown list how to find control

I need how to findcontrol editemplate control in my gridview rowediting event

i try this code but return null value any one post this code

Client Side
<asp:DropDownList id="Drpdept" CssClass="dropdown" runat="server">

Server side
protected void GrdDept_RowEditing(object sender, System.Web.UI.WebControls.GridViewEditEventArgs e)
DropDownList ddlDept = GrdDept.Rows[e.NewEditIndex].FindControl("Drpdept") as DropDownList;

Mark as Answer if its helpful to you
EmailId :


Posted by: Bandi on: 7/29/2013 [Member] [MVP] Platinum | Points: 25

Refer this link
Logic is: After setting new edit index you need to bind the data source with grid view... Then only try to find the control....

Mark This Response as Answer

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response