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

Bad sorting with grouping

Thread ID:





142702 Feb 15,2019 03:05 PM UTC Feb 21,2019 09:25 AM UTC Xamarin.Forms 5
Tags: SfDataGrid
Tomas Turek
Asked On February 15, 2019 03:05 PM UTC


I´m trying to create DataGrid in XAML (i use xamarin.forms - with your component I have 3 columns (DateTime, Date, Value). Example: 2019-02-15 23:15:10.111, 2019-02-15 00:00:00.000, "value text"

I need implement all this parameters:
 - group by: Date (only date without show time)  - i need format: 'dd.MM.yyyy' with sort descending
 - sort by: DateTime descending
 - show column: Time (HH:mm:ss) and Value

I attach a picture with wrong sort of groups (groups are not descending by date)

How to do it?

Next question: how to translate or change string 'Items'

Can you help me or provide any sample? Thx

My code: 

                <syncfusion:SfDataGrid x:Name="DataGridAlarms" ColumnSizer="Star" AutoGenerateColumns="False" RowHeight="25" SelectionMode="Single" AutoExpandGroups="False" AllowGroupExpandCollapse="True" QueryRowHeight="DataGridAlarms_QueryRowHeight">

                        <syncfusion:GroupColumnDescription  ColumnName="Date"  />

                    <syncfusion:SfDataGrid.Columns x:TypeArguments="syncfusion:Columns">

                        <syncfusion:GridDateTimeColumn MappingName="Date" HeaderText="Date" Format="dd.MM.yyyy" IsHidden="True" GroupMode="Display" SortMode="Value" AllowSorting="True" >

                        <syncfusion:GridDateTimeColumn MappingName="DateTime" Format="HH:mm:ss" HeaderText="Time" AllowSorting="True"Width="65" >
                        <syncfusion:GridTextColumn MappingName="Text" HeaderText="Value" AllowSorting="True">


                        <syncfusion:SortColumnDescription ColumnName="DateTime" SortDirection="Descending" />


Attachment: DataGrid_c372c3f7.zip

Subburaj Pandian Veluchamy [Syncfusion]
Replied On February 18, 2019 12:40 PM UTC

Hi Tomas, 
Thank you for contacting Syncfusion support. 
Query 1: Group column in descending order. 
Based on the provided information, we checked your requirement “How to sort the grouped column in descending” in default grouped column will be sorted in ascending format. If you want to sort the grouped column in descending order you have add that column in DataGrid sort Description as in the following code example. 
<sfgrid:SortColumnDescription ColumnName="Date" SortDirection="Descending" /> 
We have attached the sample for your reference. 
Query 2: How to translate or change string 'Items' 
We are unable understand your query clearly, can you provide more details about this query to provide you the better solution. 
Subburaj Pandian V   

Tomas Turek
Replied On February 19, 2019 08:40 AM UTC

Thank you for quick reply with a sample.

1) I tried your code, but if I changed items (change date and datetime range to a longer period) the groups are still not descending by date (only descending by start numbers). I added sample and picture(1 and 2).

Descending groups by date working only if I use - [GroupMode="Value"] (not Display) - but if I do it, groups contain unwanted time "0:00:00" (picture 3)

2) Translate word 'items' in grouping - I want to change this word (I want to translate it to another language)

Current: Date : 21.10.2019 - 2 Items
I want: Date : 21.10.2019 - 2 Položky (Záznamy,...)

Attachment: Samples_2019_02_19_6a1e2175.zip

Subburaj Pandian Veluchamy [Syncfusion]
Replied On February 20, 2019 11:51 AM UTC

Hi Tomas, 
Thank you for the update. 
Query 1: Need to display Date alone in caption summary row and Group mode  
We have checked your query and created a sample based on your requirement. In that we have displayed Date alone without time in caption summary row and used Group Mode as value and we have achieved this requirement using Custom aggregate in summary row.  
Please find the sample by the following link,  
Please refer the following UG for more details to customizes summary row, 
Query 2:  Regarding localization of string “Items”. 
Please translate the word Items based on the language and Concat or append the string with Summary Title. 
string translate = "Items"; 
GridSummaryRow summaryRow = new GridSummaryRow(); 
summaryRow.Title = "Date : {CaptionSummary} " + translate; 
summaryRow.ShowSummaryInRow = true; 
summaryRow.SummaryColumns.Add(new GridSummaryColumn 
    Name = "CaptionSummary", 
    CustomAggregate = new CustomAggregate(), 
    MappingName = "Date", 
    Format = "{Date}", 
    SummaryType = Syncfusion.Data.SummaryType.Custom 
dataGrid.CaptionSummaryRow = summaryRow; 
Please let us know, if you need further assistance on this.  
Subburaj Pandian V  

Tomas Turek
Replied On February 21, 2019 09:20 AM UTC

Thank you very much. Now everything works perfectly.

Subburaj Pandian Veluchamy [Syncfusion]
Replied On February 21, 2019 09:25 AM UTC

Hi Tomas, 
Thank you for the update. We are happy that the given solution meets your requirement. 
Please get in touch with us if you would require any further assistance. 
Subburaj Pandian V  


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

This page will automatically be redirected to the 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

Live Chat Icon For mobile
Live Chat Icon