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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Reg: GridControl (Monthcalendar Property)

Thread ID:

Created:

Updated:

Platform:

Replies:

33479 Aug 22,2005 05:41 AM UTC Aug 22,2005 10:14 AM UTC WinForms 1
loading
Tags: GridControl
Anna Srinivasan
Asked On August 22, 2005 05:41 AM UTC

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 10:14 AM UTC

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.

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

;