I tried to use the following code snippet in the PreRender event to change the HeaderText but it is not working.
Actually, I just noticed RadGrid1.columns
was empty (with a break point) but my RadGrid has 3 columns:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
foreach (GridColumn col in RadGrid1.Columns)
{
if (col.UniqueName == "idAgir")
col.HeaderText = "Numéro";
if (col.UniqueName == "objet")
col.HeaderText = "Titre du Ticket";
if (col.UniqueName == "dateEtatIncident")
col.HeaderText = "Date dernière intervention";
}
RadGrid1.Rebind();
}
var masterTableView = RadGrid1.MasterTableView;
var column = masterTableView.GetColumn("idAgir");
column.HeaderText = "Numéro";
masterTableView.Rebind();