We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to change GroupCaptionText based on the Display member of the GridComboboxColumn?

While grouping the GridComboBoxColumn, the Group key displayed in the GroupCaptionText is based on the SelectedValuePath instead of the DisplayMemberPath of the GridComboBoxColumn. In the following code example, GridComboBoxColumn is defined with the DisplayMemberPath and SelectedValuePath.

XAML

The following is the ViewModel class with ItemsSource for the GridComboBoxColumn.

C#

In the following screenshot, the GroupKey displays the actual value instead of the display value of the column.

Figure 1: SfDataGrid with GroupKey displaying the actual value

It is possible to display the GroupKey based on the DisplayMemberPath in the GroupCaptionText by setting the GroupColumnDescription.Converter property that converts the actual value based on the DisplayMemberPath. GridComboBoxColumn is passed as the Converter parameter, and the underlying record bound with the row is passed as the value for the converter. Refer to the following code example for customizing the GroupColumnDescription with the Converter defined.

XAML

The following is the Converter that returns the GroupKey based on the DisplayMemberPath by using the value, Record, and the parameter, Column, passed.

C#

The following screenshot shows the GroupKey changed based on the DisplayMemberPath.

C:\Users\mahendrana\Desktop\GroupKey-WinRt1new1.png

Figure 2: GroupKey changed

When you group at runtime by dragging and dropping the column into the GroupDropArea, you can set the Converter by handling SfDataGrid.View.GroupDescriptions.CollectionChanged as shown in the following code example.

C#

Note: The following code example explains how to change the GroupKey in GroupCaptionText based on DisplayMember of MultiColumnDropDownList.

XAML

C#, Converter class

 

Sample Links:

WRT

UWP

Article ID: Published Date: Last Revised Date: Platform: Control:
4552 04/20/2015 01/19/2016 WinRT SfDataGrid
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon