AUTHOR: Eyup Yusein
DATE POSTED: January 01, 2018
DESCRIPTION It is possible to get the GridHeaderItem instance during the PreRender event handler of the grid and change the text of any cell using the headerItem["ColumnName"].Text = "New Value" approach: https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/how-to/Common/using-the--getitems-getcolumn-and-getcolumnsafe-methods#items However, when the AllowSorting setting is enabled, changing the Text property of the cell directly breaks the sorting functionality of the column, because it clears the inner controls within the given cell.
SOLUTION You can use one of the following approaches to resolve the issue: 1. DataBinding:
protected
void
RadGrid1_DataBinding(
object
sender, EventArgs e)
{
RadGrid1.MasterTableView.GetColumn(
"ShipName"
).HeaderText =
"Success"
;
}
2. PreRender:
RadGrid1_PreRender(
TableCell cell = RadGrid1.MasterTableView.GetHeaderCellByColumnUniqueName(
);
(cell.Controls[0]
as
LinkButton).Text =
Resources Buy Try