This question is locked. New answers and comments are not allowed.
Hello,
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:
Employee:
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
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:
Employee:
[MetadataTypeAttribute(typeof(Employee.EmployeeMetadata))] 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; } }}
XAML:<telerik:RadGridView x:Name="empList" ItemsSource="{Binding Employees}" > <telerik:RadGridView.Columns> <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding EmployeeCategory}"/> </telerik:RadGridView.Columns> <telerik:RadGridView.GroupDescriptors> <telerik:GroupDescriptor Member="EmployeeCategory" /> </telerik:RadGridView.GroupDescriptors></telerik:RadGridView>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