Grouped column names

3 posts, 0 answers
  1. Al
    Al avatar
    221 posts
    Member since:
    Oct 2006

    Posted 23 Nov 2015 Link to this post

    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. Eyup
    Admin
    Eyup avatar
    3819 posts

    Posted 25 Nov 2015 Link to this post

    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
  3. Al
    Al avatar
    221 posts
    Member since:
    Oct 2006

    Posted 25 Nov 2015 in reply to Eyup Link to this post

    Thanks, that sorted out the names in the group-by box as well as on the grid's context menu.
Back to Top