Hey guys,
i want to change the header text of the gridview using Design.. from <TemplateField HeaderText="">
i created a variable in code behind which is public and set the value in that variable and then i tried to call that variable over here as below:
<TemplateField HeaderText = '<%= VariableCallHere %>'
but while running page i got <%= VariableCallHere %> as a header text
even i tried changing using gridView1.HeaderRow.Cells[0].Text = "text Here"
(This Throws object reference error)
Any one have any suggestions how this could be achieved..
I'm using it like this for multilingual it works fine NO need of extra work for iterating the rows just put it there and let it do the work
For this, in the RowDataBound event of the gridview control you need to write as like follows:
Access it via the columns collection:
As in:
It should be
gridview1.Columns[ColumnIndex].HeaderText = "Header text";
in RowCreated Event of Gridview. Using and Label in .