How to Find Control RowEditing Event

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

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
this

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
================
<EditItemTemplate>
<asp:DropDownList id="Drpdept" CssClass="dropdown" runat="server">
</asp:DropDownList>
</EditItemTemplate>

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


Responses

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

Up
0
Down
Refer this link
http://forums.asp.net/post/3615893.aspx
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
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

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

Login to post response