vml19
vml19

Reputation: 3864

Accessing gridview's header controls in ASP.Net, C#

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

Answers (1)

Prashanth Thurairatnam
Prashanth Thurairatnam

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

Related Questions