Hi. I am successfully setting the header text for a column in the code behind, like so:
The column code is this (the sortexpression is static):
The column header is not sortable. If I hardcode the headertext, the sorting works fine. Am I missing a step?
Thanks.
protected void RadGrid_Subs_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridHeaderItem) |
{ |
GridHeaderItem header = (GridHeaderItem)e.Item; |
header["linklabel"].Text = headerText; |
} |
} |
The column code is this (the sortexpression is static):
<telerik:GridTemplateColumn SortExpression="linklabel" UniqueName="linklabel" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" > |
<ItemTemplate> |
<%# BuildLink(DataBinder.Eval(Container.DataItem, "linkID"), DataBinder.Eval(Container.DataItem, "linkLabel"), DataBinder.Eval(Container.DataItem, "forumID"), DataBinder.Eval(Container.DataItem, "isCase"))%> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
The column header is not sortable. If I hardcode the headertext, the sorting works fine. Am I missing a step?
Thanks.