Grouping shows wrong name in header

2 posts, 0 answers
  1. Tobania
    Tobania avatar
    160 posts
    Member since:
    Apr 2010

    Posted 09 Aug 2010 Link to this post


    I have a list of Employees that is set as the ItemsSource for a RadGridView. The headers of each column are determined by the metadata defined on the EmployeeEntity. This way the column headers are always shown in the right language for the user. This works as expected:

        public partial class Employee
           internal sealed class EmployeeMetadata
                // Metadata classes are not meant to be instantiated.
                private EmployeeMetadata()
                [Display(ResourceType = typeof(EmployeeResources), Name = "NameDisplay")]
                public string Name{ get; set; }
                [Display(ResourceType = typeof(EmployeeResources), Name = "CategoryDisplay")]
                public string EmployeeCategory{ get; set; }

    <telerik:RadGridView x:Name="empList" ItemsSource="{Binding Employees}" >
          <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" />
          <telerik:GridViewDataColumn DataMemberBinding="{Binding EmployeeCategory}"/>
          <telerik:GroupDescriptor Member="EmployeeCategory" />

    This shows fore example as the headers for the datacolumns: "Naam" and "MedewerkersCategorie", because that is the way "NameDisplay" and "CategoryDisplay" are defined in the resources file.

    The problem is when I define groupîng like I did in the example, the group header simply shows "EmployeeCategory" and not "MedewerkersCategorie". If I however not group programmatically but via the user interface, the correct header name is shown.

    I've searched the forums and the only workable solution they propose is to catch the grouping event of the grid, and whenever the name of the column to group upon is equal to "EmployeeCategory" return a string from the resources file.

    What is the correct way to solve this situation?

    Thank you,
    Sodi We
  2. Maya
    Maya avatar
    4062 posts

    Posted 11 Aug 2010 Link to this post

    Hello Sodi We,

    The workaround with handling the Grouping event is quite correct. You may take a look at this forum thread for a reference. 

    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
Back to Top