How to Show the Month name (Es. Settembre) in CaptionSummaryRow

Hi,

I've a SfDatagrid with a column containing a date formatted to show the month name as follow:

DBGridScadenze.Columns.Add(new GridDateTimeColumn() { MappingName = "MeseScad", HeaderText = "Mese", Format = "MMMM" });

The grid is populated with a observablecollection and when is loaded all work fine, but when I group the column Month, in the caption summary is displayed the date instead of the month name.

Image_1726_1726241097179

The capiton is formatted as below:

GridSummaryRow captionSumScadForn = new GridSummaryRow();

captionSumScadForn.Name = "CaptionSummary";

captionSumScadForn.ShowSummaryInRow = true;

captionSumScadForn.Title = "{ColumnName}: {Key} - Nr. {ItemsCount} Scadenze - Tot. Importo: {Importo}";


How can I format the caption to show the Month Name?

Thanks in advance

Regards


10 Replies

MA Manikanda Akash Munisamy Syncfusion Team September 16, 2024 02:49 PM UTC

Hi Maurizio,

We have reviewed your scenario regarding the CaptionSummaryRow text format matching the GridDateTimeColumn values. This can be achieved by setting GroupMode = DataReflectionMode.Display for that particular column, which ensures that the view is based on the formatted display value. We have prepared and attached a sample for your reference.


Code Snippet:
  sfDataGrid1.Columns.Add(new GridDateTimeColumn() { MappingName = "ShippingDate", Format ="MMMM", GroupMode=DataReflectionMode.Display });


Could you please review the sample and confirm if it aligns with your requirements?

 

If we have misunderstood any aspect of your needs, kindly provide additional details about the issues you're encountering. Your feedback will help us better understand the problem and provide an appropriate solution.

 

We look forward to your response.


Regards,

Manikanda Akash

Attachment: SfDataGrid_Demo_4_8_d24fd46.zip



MA Maurizio replied to Manikanda Akash Munisamy September 16, 2024 03:12 PM UTC

Hi,

I've tested your sample and implemented your code in my projects and now all work fine how expected.


Thanks

Regards



MA Manikanda Akash Munisamy Syncfusion Team September 17, 2024 05:05 AM UTC

Hi Maurizio,

You're welcome. Please get back to us if you need any further assistance, we will be happy to help you.

Regards,
Manikanda Akash



MA Maurizio March 21, 2025 04:52 PM UTC

Hi,

sorry to reopen this old post, but I noticed a problem occurs when I group the data by month and I do a sort. As you can see from the photo below, when I do a grouping by month the sorting is done alphabetically and not by time date (January, February, March, April etc.)

Image_5980_1742575615548

How can I solve it?

Thanks in advance

Regards



RM Rabina Murugan Syncfusion Team March 24, 2025 06:51 AM UTC

Hi Maurizio,

 

We have investigated your reported scenario. Since the group mode is set to Display for grouping the column based on the month format instead of the actual DateTime value, the sorting is also performed based on the displayed text.

 

To address this, we have implemented a Custom Sort Comparer for accurate sorting of month values when the group mode is set to Display. This ensures proper sorting order for grouped data.

 

Kindly find the attached sample  for detailed implementation and video for reference.

Please let us know if you need any further assistance.

 

Regards,

Rabina


Attachment: CustomSorting_bba0981c.zip


MA Maurizio April 1, 2025 05:00 PM UTC

Hi,

Thanks for the support.

Now all work fine.

Regards



RM Rabina Murugan Syncfusion Team April 2, 2025 04:58 AM UTC

Hi Maurizio,
You're welcome. Please get back to us if you need any further assistance, we will be happy to help you.
Regards,
Rabina


MA Maurizio August 4, 2025 05:28 PM UTC

Hi,

sorry if I reopen this old post, but I noticed a problem occurs when I enable the property AllowFiltering on the column 'Month'. How can you see in the follow picture, when I open the Filter Popup, the month 'settembre' is showed two times because the records have two different date of 'scadenza' (03/09/2025 and 30/09/2025). Instead of 'ottobre' that correctly is showed one time because the two records have the same date.

Image_5100_1754322792756

I verified that the problem also occurs in your attached example of march 24th.

How can I solve the problem to show the month only one time?

Thanks in advance

Regards



RM Rabina Murugan Syncfusion Team August 5, 2025 04:05 PM UTC

Maurizio,

 

We have created a new forum for your latest update, as this is a new query. We kindly request that you follow up on the new forum.
 

Forum Link: How to remove duplicates in the FilterControl ~ Split from 194423 | Syncfusion Forum Assist



RM Rabina Murugan Syncfusion Team August 6, 2025 07:55 AM UTC

Maurizio,

 

Please ignore the previous update. Please follow the below new forum for your latest update.

 

Forum link: How to remove duplicates in the Fil... | WinForms Forums | Syncfusion®


Loader.
Up arrow icon