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. Image for the cookie policy date

ColumnGrouping is lost when reloading ItemsSource

Hi,

I've a SfDataGrid with ColumnGrouping. When ItemsSource (ObservableCollection) will be updated, then ColumnGrouping disappears.

Please find attached demonstration sample.

Regards

Harald

Attachment: SfGridSample8_7e235e79.zip

3 Replies

JG Jai Ganesh S Syncfusion Team November 30, 2016 12:58 PM UTC

Hi Harald , 
You can achieve your requirement for maintaining the Grouping while changing the ItemsSource by setting the AutoGenerateColumnsMode like below, 
 
<syncfusion:SfDataGrid 
                x:Name="SampleDataGrid"  
                AutoGenerateColumnsMode="RetainOld" 
                ItemsSource="{Binding GridDataSource}" 
                AutoExpandGroups="True" 
                AutoGenerateColumns="True"/> 
  
Regards, 
Jai Ganesh S 



HB Harald Betzler December 2, 2016 09:32 AM UTC

Hi Jai,

this works fine. Thanks for your help.

Regards
Harald


JG Jai Ganesh S Syncfusion Team December 5, 2016 01:19 AM UTC

Hi Harald, 
 
Thank you for the update. 
 
Please let us know if you need further assistance in this. 
 
Regards, 
Jai Ganesh S 


Loader.
Up arrow icon