F
fredd00
hi
i'm trying to change the gridview columns header text
the columns are not auto generated, i have set specific headertext
values for each column
i want to change the header text based on the specific header text. i
want to load a new text from a global resource file.
what i'm actually trying to do and is not working :
protected void RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header) //
DataControlRowType.DataRow
{
foreach (TableCell tc in e.Row.Cells)
{
string s =
(string)GetGlobalResourceObject("General", tc.Text);
if (s != null)
{
tc.Text = s;
}
}
}
}
the problem is that tc.Text is always ""
if i'm going through a DataControlRowType.DataRow there is text in
tc.Text
any idea when the header text if filled in ?
i'm trying to change the gridview columns header text
the columns are not auto generated, i have set specific headertext
values for each column
i want to change the header text based on the specific header text. i
want to load a new text from a global resource file.
what i'm actually trying to do and is not working :
protected void RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header) //
DataControlRowType.DataRow
{
foreach (TableCell tc in e.Row.Cells)
{
string s =
(string)GetGlobalResourceObject("General", tc.Text);
if (s != null)
{
tc.Text = s;
}
}
}
}
the problem is that tc.Text is always ""
if i'm going through a DataControlRowType.DataRow there is text in
tc.Text
any idea when the header text if filled in ?