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.

Reg: GridControl (Monthcalendar Property)

Thread ID:

Created:

Updated:

Platform:

Replies:

33479 Aug 22,2005 01:41 AM Aug 22,2005 06:14 AM Windows Forms 1
loading
Tags: GridControl
Anna Srinivasan
Asked On August 22, 2005 01:41 AM

Hi, Please, go through my sample code. Problem: Example 1) Select Feb 10.(It showing correct MM/dd/yyyy) fromat. 2) Again try to click datetime picker. (it suppose to show feb sheet but it showing correspondong date(10) month (October).[2nd October] MonthCalendar_2092.zip Thanks, Anna

Administrator [Syncfusion]
Replied On August 22, 2005 06:14 AM

When I run your sample, I do not see a problem unless I change my regional setting so that the string 02/10/2005 will be interpreted as Oct 10. I assum ethis is the problem you are seeing too. If so, you can avoid it by handling the CurrentCellShowingDropDown event as below.
private void gridControl1_CurrentCellShowingDropDown(object sender, GridCurrentCellShowingDropDownEventArgs e)
{
	GridCurrentCell cc = this.gridControl1.CurrentCell;
	if(cc.Renderer is GridDropDownMonthCalendarCellRenderer)
	{
		GridDropDownMonthCalendarCellRenderer cr = cc.Renderer as GridDropDownMonthCalendarCellRenderer;
		if(cc.Renderer.ControlValue != null && cc.Renderer.ControlValue != DBNull.Value)
		{
			DateTime dt = (DateTime) cc.Renderer.ControlValue;
			cc.Renderer.ControlText = dt.ToString("g");
		}
	}
}

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.

;