Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Header Text of Gridview Cell

I've a gridview in my web form and I'm using a the following code in my web form's Save button:

foreach (GridViewRow row in gvList.Rows)
            if (row.RowType == DataControlRowType.DataRow)
            {  for (int i = 0; i < row.Cells.Count; i++)
                {
                    string headerRowText = ???;

How can I get the current cell's header text.

like image 438
hotcoder Avatar asked Jan 19 '10 05:01

hotcoder


1 Answers

I solved it using:

  string headerRowText = gvList.HeaderRow.Cells[i].Text;
like image 163
hotcoder Avatar answered Oct 04 '22 23:10

hotcoder