dynamically changing header text of gridview at runtime.

Posted by A4u6178 under C# category on | Points: 40 | Views : 6138
The following code snippet can be used to change the header text of a gridview at runtime on event "OnRowCreated="newRow".

protected void newRow(object sender, GridViewRowEventArgs e)
if (e.Row.RowType == DataControlRowType.Header)
e.Row.Cells[3].Text = "lastname";


Comments or Responses

Posted by: T.saravanan on: 6/3/2011 Level:Silver | Status: [Member] [MVP] | Points: 10

Kindly mentioned which control you were used in your code
and also post your code inside the code tag.
Posted by: A4u6178 on: 6/4/2011 Level:Starter | Status: [Member] | Points: 10
Hi T.saravanan,

Thanks . I will make sure of correcting such mistakes from now onwards.

Posted by: T.saravanan on: 6/5/2011 Level:Silver | Status: [Member] [MVP] | Points: 10

Login to post response