Group by column name from ViewModel

In VM I have a string property called "GroupBy" 

In XAML I have :

 <syncfusion:SfDataGrid.GroupColumnDescriptions>

                        <syncfusion:GroupColumnDescription ColumnName="{Binding GroupBy}" />

 </syncfusion:SfDataGrid.GroupColumnDescriptions>

But it don't work.

How to perform grouping from column name provided from 




1 Reply

LN Lakshmi Natarajan Syncfusion Team July 11, 2022 07:33 AM UTC

Hi Marcin,


We would like to inform you that the grouping will be based on the field value. To apply grouping in SfDataGrid, you must set the PropertyName as the ColumnName (i.e., Model property). As a result, we recommend that you define the GroupBy property in the model class to meet your needs.


Please refer to our user guidance document regarding the same,

UG link: https://help.syncfusion.com/xamarin/datagrid/grouping#programmatic-grouping


You can also refer to our online documentation to group by a column that is not in columns collection below,

KB link: https://www.syncfusion.com/kb/7396/how-to-group-by-a-column-that-is-not-in-columns-collection


Please let us know if you need further assistance.


Regards,

Lakshmi Natarajan



Loader.
Up arrow icon