Reputation: 3864
I have Gridview and the headers are having textboxs and labels, I have a search button out side of the gridview and when a user clicks on search I need to filter gridview's data by respective column's texbox values.
Upvotes: 1
Views: 3490
Reputation: 4361
Try this
TextBox textBox = (TextBox)gridView1.HeaderRow.FindControl("contorlId");
to specifically search within a column identify the cell by the index
TextBox textBox = (TextBox)gridView1.HeaderRow.Cells[0].FindControl("contorlId");
Upvotes: 2