Click here to Skip to main content
15,894,955 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have web form with a GridView and a few controls in the GridView. I have a DropDownList in the EdtItemTemplate of the gridview.

I am needing to bind this DropDownList with some method in my CodeBehind File.

The problem I am facing is this. Since the Control is sitting in the EditItemTemplate, using the FindControl("MyControlID") does not seem to work in any of the GridView events, it returns null, in other words it cannot seem to find the control, unless I use the OnRowUpdating event, but I cannot use this event as the Control needs to be Data binded before that.

Is there anyway I can use the <%# Bind("MyMethodName") %> to bind the control?
Posted

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