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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to customize Group header when user add a column to the group area

Thread ID:





116943 Jul 7,2014 03:11 PM UTC Jul 11,2014 06:23 AM UTC WPF 1
Tags: SfDataGrid
Pierre-Alain GALTIER
Asked On July 7, 2014 03:11 PM UTC


I want to allow user to group data using a column binded to a enum value.
I can define a default grouping but if user removes the column and adds it again, the header formating is lost

                <data:SortComparer Comparer="{StaticResource customSortComparer}" PropertyName="MeasureTypeEnum" />
                <syncfusion:GroupColumnDescription ColumnName="MeasureTypeEnum" Converter="{ StaticResource customGroupConverter }"/>

Any way to make the default column description always set ?

Thank you

Akila Rajaram [Syncfusion]
Replied On July 11, 2014 06:23 AM UTC

Hi Pierre,

We have analyzed your query. You can achieve your requirement by handling GroupDescriptions.CollectionChanged event and setting Converter for the column that is going to be grouped at runtime.

Please refer the following code snippet,

Code snippet:

public MainWindow()



            this.sfGrid.ItemsSourceChanged += sfGrid_ItemsSourceChanged;


void sfGrid_ItemsSourceChanged(object sender, GridItemsSourceChangedEventArgs e)


            this.sfGrid.View.GroupDescriptions.CollectionChanged += GroupDescriptions_CollectionChanged;


void GroupDescriptions_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)


            if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)


                if ((e.NewItems[0] as PropertyGroupDescription).PropertyName == "Date")


                    (e.NewItems[0] as PropertyGroupDescription).Converter = new GroupDataTimeConverter();





Please let us know if you have any queries.



Attachment: GroupingDemo_23f39528.zip


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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