dynamically changing header text of gridview at runtime.

A4u6178
Posted by A4u6178 under C# category on | Points: 40 | Views : 6218
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
Hi,

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
Ok.Good.

Login to post response