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

How to set CultureInfo for MonthCalendar cell type

Thread ID:

Created:

Updated:

Platform:

Replies:

64256 Jul 17,2007 11:15 AM Jul 17,2007 06:19 PM Windows Forms 3
loading
Tags: GridControl
Maxim Software Systems
Asked On July 17, 2007 11:15 AM

Is it possible to set the CultureInfo for the MonthCalendar control cell type? When I set a grid cell's type to MonthCalendar, it ignored the custom CultureInfo value I set for the cell and seems to use the Windows regional settings instead.

haneefm [Syncfusion]
Replied On July 17, 2007 11:59 AM

Hi Don,

Is it possible to set the CultureInfo for the MonthCalendar control cell type?
>>>>>>>>
You can try these code:

this.grid[1,1].CellType = "MonthCalendar";
this.grid[1,1].CellValueType = typeof(DateTime);
this.grid[1,1].CultureInfo = new System.Globalization.CultureInfo("zh-HK");

Best regards,
Haneef

Maxim Software Systems
Replied On July 17, 2007 02:55 PM

That sort of worked. The date I select in the MonthCalendar now gets put into the cell in the proper format (dd/mm/yyyy as opposed to my Windows setting of mm/dd/yyyy), but I am now getting an "date format not recognized" error after that. It's as if the cell is validating the date that the calendar is returning, using a different CultureInfo to do it.


haneefm [Syncfusion]
Replied On July 17, 2007 06:19 PM

Hi Don,

The GridStyleInfo.Format property string used to format the text to display in the grid. you can specify the numeric format string, Date format string or enumeration format string by using this property. Below is a code snippet that set the "MM/dd/yyyy" format.

this.gridControl1[1, 1].Format = "MM/dd/yyyy";

Best regards,
Haneef

CONFIRMATION

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.

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.

;