I am using the following code to change the header on a grid:
protected
void RouteInquiryGrid_ItemDataBound(object sender, GridItemEventArgs e)
{
if ((e.Item is GridHeaderItem))
{
GridHeaderItem header = (GridHeaderItem)e.Item;
if (SessionHelper.Instance.WeightUOM.Id == WeightUOM.English.Id)
{
header[
"ContainerWeightQty"].Text = "Weight" + WeightUOM.GetAsString(WeightUOM.English.Id);
}
else
{
header[
"ContainerWeightQty"].Text = "Weight" + WeightUOM.GetAsString(WeightUOM.Metric.Id);
}
}
}
This works great and the header text is changed. However, when I do this I lose the ability to sort on the column. Is there an easy way to get the sort active again.
Thanks,
- Adam