SfDataGrid Paging, Grouping, and Sorting

Dear support,

I am using the SfDataGrid control in my project and implemented paging on the grid. It worked well until I published an update of the app, when users informed me that the paging is not working anymore. Any help would be appreciated.

Here is the code I use to populate the SfDataPager and SfDataGrid.
                    dataPager.Source = gridList;
                    dataPager.PageSize = 7;
                    dataGrid.ItemsSource = dataPager.PagedSource;

Also, is it possible to remove the column name from the group row header? At the moment it displays the column name when grouping, as such:
                    Group_Description: XXXX
(where XXXX is the actual value I want to display).

I also enabled sorting on the SfDataGrid, but that has also stopped working.
                    AllowSorting="True"

Any help would be greatly appreciated.

Regards,

4 Replies 1 reply marked as answer

KK Karthikraja Kalaimani Syncfusion Team March 26, 2021 05:59 AM UTC

Hi Jano,

Regarding the “Paging is not working”

Since we are not aware of your exact application situation, please share the
following information in order to test it further and have a potential solution sooner.   

i) Complete configuration of SfDataGrid.

ii) Video of the issue.

iii) SfDataGrid and Xamarin Forms versions.

iv) In which platform you are facing the issue?

Regarding “
is it possible to remove the column name from the group row header”

You can change the caption summary row in two ways.

- By writing template for caption summary row. Please refer to the below UG document.
https://help.syncfusion.com/xamarin/datagrid/summary#caption-summary-template

- By writing Converters for Caption summary row. Please refer to the below UG document.
https://help.syncfusion.com/xamarin/datagrid/summary#custom-summaries

Regarding the “Sorting not working”

Can you please confirm whether you are defined SortColumnDiscription or not ?

https://help.syncfusion.com/xamarin/datagrid/sorting#programmatic-sorting


Regards,
Karthik Raja
 


Marked as answer

JA Jano March 26, 2021 06:31 AM UTC

Hi Karthik Raja,

Thank you for your fast response.

For the first issue, here is the configuration of the datagrid and datapager
<datagrid:SfDataGrid x:Name="grid"
                                         ColumnSizer="Auto"
                                         AutoGenerateColumns="False"
                                         SelectionMode="Single"
                                         AllowSorting="True"
                                         AllowSwiping="True"
                                         SwipeEnded="enquiry_grid_SwipeEnded"
                                         AllowDraggingColumn="True"
                                         VerticalOverScrollMode="None"
                                         NotificationSubscriptionMode="None"
                                         EnableDataVirtualization="True"
                                         LiveDataUpdateMode="AllowDataShaping">
                        <datagrid:SfDataGrid.SortColumnDescriptions>
                            <datagrid:SortColumnDescription ColumnName="Customer" />
                        </datagrid:SfDataGrid.SortColumnDescriptions>
                        <datagrid:SfDataGrid.LeftSwipeTemplate>

                            <DataTemplate>

                                <Grid BackgroundColor="#34617f">

                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"/>
                                        <ColumnDefinition Width="100"/>
                                    </Grid.ColumnDefinitions>

                                    <Button Text="Edit"
                                                  BackgroundColor="#34617f"
                                                  Clicked="Edit_Clicked"/>

                                    <Grid Grid.Column="1" BackgroundColor="#bd565f">

                                        <Button Text="Delete"
                                                      BackgroundColor="#bd565f"
                                                      Clicked="Delete_Clicked"/>
                                    </Grid>
                                </Grid>
                            </DataTemplate>
                        </datagrid:SfDataGrid.LeftSwipeTemplate>
                    </datagrid:SfDataGrid>

                    <sfPager:SfDataPager x:Name ="dataPager" />

                    dataPager.Source = gridSource;
                    dataPager.PageSize = 7;
                    grid.ItemsSource = dataPager.PagedSource;

I am unable to provide a video, but what happens is that the datagrid and the pager loads perfectly, but switching between pages does not update the content of the datagrid (when the pager is on page 2, the datagrid content is still on page 1).

I am facing the issue in the Android application, and I am using Xamarin Forms version 5.0.0.1874 and SfDataGrid version 18.4.0.49.

Regarding the sorting, I can confirm that using a SortColumnDescription does work, I'll change my code so that all columns where sorting would be appropriate uses custom sorting.

Thanks for the referral to the appropriate documentation for custom group summary rows as well.

I hope that the above information is sufficient.

Regards,
Jano


JA Jano March 29, 2021 06:34 AM UTC

I found the culprit responsible for the paging and sorting not working. I set the property NotificationSubscriptionMode="None". It works fine now. I added the property because I read it improves the SfDataGrid performance, but will look more carefully in the future when adding properties.

Thanks again for the help.

Regards,
Jano


KK Karthikraja Kalaimani Syncfusion Team March 29, 2021 06:41 AM UTC

Hi jano,

Thanks for the update. We glad to know that your issue has been resolved. Please get in touch if you required further assistance on this. 

Regards,
 
Karthik Raja 


Loader.
Up arrow icon