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()
{
InitializeComponent();
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.
Regards,
Akila
Attachment:
GroupingDemo_23f39528.zip