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

How to set different cultures for GridDateTimeColumn in the SfDataGrid ?

Platform: WPF |
Control: SfDataGrid |
.NET Framework: 4.5

In the SfDataGrid, the GridDateTimeColumn provides support to display the date time value. You can set different cultures for the GridDateTimeColumn by using the ConverterCulture property in the DisplayBinding and ValueBinding property of that column as shown in the following code example.



Two different cultures, fr-FR and en-US are defined to different GridDateTimeColumns. The GridDateTimeColumn value is displayed based on the pattern, by default. So, the ConverterCulture is not considered for the display mode.

Note: By default, short date pattern is applied to the GridDateTimeColumn.


To overcome this, you need to return culture formatted column value with the help of the converter in the DisplayBinding as shown in the following code example.



Based on the above culture, the GridDateTimeColumn is displayed in the following screenshot.

Figure 1: GridDateTimeColumn with different cultures

The above culture is set in the Display mode of the GridDateTimeColumn when you want to set the same culture format in the edit mode by deriving a new class from the GridCellDateTimeRenderer and overriding the OnInitializeEditElement virtual method.

 The following code example illustrates the override of a new class from the existing GridCellDateTimeRenderer.



The DateTimeFormat is get from the corresponding column’s ValueBinding and assigned the DateTimeEdit UIelement that is loaded in the edit mode of the GridDateTimeColumn. Refer to the following code example to remove the default GridCellDateTimeRenderer and add the customized GridCellDateTimeRendererExt to the renderer’s collection in the SfDataGrid.



Sample Link:









2X faster development

The ultimate WPF UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

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