This is a migrated thread and some comments may be shown as answers.

Grouped column names

2 Answers 7 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Al
Top achievements
Rank 1
Iron
Iron
Veteran
Al asked on 23 Nov 2015, 10:01 AM

Hi,

My grid is databound using NeedDataSource and I localize my column names in the Pre-Render event. When I enable ShowGroupPanel to allow users to drag columns for grouping, the name that appears in the group box and in the grouping row titles is not the localized name. I have searched the column properties but I can't see anything obvious for this - what do I need to set in order to get the names displaying correctly?

2 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 25 Nov 2015, 07:40 AM
Hi Al,

You can use the following approach to achieve this requirement:
protected void RadGrid1_DataBinding(object sender, EventArgs e)
{
    foreach (GridColumn col in RadGrid1.MasterTableView.RenderColumns)
    {
        string newHeaderText;
        switch (col.UniqueName)
        {
            case "ShipCountry": newHeaderText = "Altered"; break;
            case "Freight": newHeaderText = "Modified"; break;
            default: newHeaderText = "Success"; break;
        }
        col.HeaderText = newHeaderText;
    }
}

Hope this helps. Please give it a try and let me know if it works for you.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Al
Top achievements
Rank 1
Iron
Iron
Veteran
answered on 25 Nov 2015, 08:46 AM
Thanks, that sorted out the names in the group-by box as well as on the grid's context menu.
Tags
Grid
Asked by
Al
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Eyup
Telerik team
Al
Top achievements
Rank 1
Iron
Iron
Veteran
Share this question
or