How to handle the dates as strings in the WinForms PivotGridControl?
Handle the dates as strings
When the date is set as a string format, it sorts the records based on the string and does not sort the record correctly in the Date string. So, use the dataset and apply the format property in the PivotItem class.
C#
//Sets date time column.
dt.Columns.Add("Date", typeof(DateTime));
//Sets Date Time format to the Pivot Row.
this.pivotGridControl1.PivotRows.Add(new PivotItem { FieldMappingName = "Date", Format = "MM/dd/yyyy", TotalHeader = "Total" });'Sets date time column
dt.Columns.Add("Date", GetType(DateTime))
'Sets Date Time format to the Pivot Row.
Me.pivotGridControl1.PivotRows.Add(New PivotItem With {.FieldMappingName = "Date", .Format="MM/dd/yyyy", .TotalHeader = "Total"})
Figure 1: Before formatting

Figure 2: After formatting
Samples:
Conclusion
I hope you enjoyed learning about how to handle the dates as strings in the PivotGridControl.
You can refer to our WinForms PivotGridControl feature tour page to know about its other groundbreaking feature representations. You can also explore our WinForms PivotGridControl documentation to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!