Link to home
Start Free TrialLog in
Avatar of maqskywalker
maqskywalker

asked on

Using FindControl to find TextBox in HeaderTemplate of DataGrid in ASP.NET WebForms

https://stackoverflow.com/questions/615950/how-do-i-access-a-control-in-the-headertemplate-of-my-gridview

In the above link there is this example:

Which uses FindControl to find a TextBox found in the HeaderTemplate of a ASP.NET Web Forms GridView.

User generated image
Notice how it uses HeaderRow like this:  GV1.HeaderRow

I'm working on an old legacy web app which uses the older ASP.NET Web Forms DataGrid

DataGrid does not have HeaderRow.


What's the equivalent to these 2 lines for a DataGrid ?

        GridView GV1 = (GridView)FindControl("Lab_1_GV1");
        TextBox TXB1 = (TextBox)GV1.HeaderRow.FindControl("Lab_1_TX2GV1");
ASKER CERTIFIED SOLUTION
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial