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.

Calendar cells restricting dates . .

Thread ID:





32292 Jul 26,2005 03:41 PM Jul 26,2005 06:12 PM Windows Forms 1
Tags: GridControl
Adam K.
Asked On July 26, 2005 03:41 PM

Can you restrict a cell with CellType = "MonthCalendar" to not allow days in the past or a date range. thanks, ak

Administrator [Syncfusion]
Replied On July 26, 2005 06:12 PM

You can catch the CurrentCellShowingDropDown event and set the Maxdate and Mindate on the embedded MonthCalendar at that point.
private void gridControl1_CurrentCellShowingDropDown(object sender, 
	                                   GridCurrentCellShowingDropDownEventArgs e)
	GridDropDownMonthCalendarCellRenderer cr = this.gridControl1.CurrentCell.Renderer 
		                                        as GridDropDownMonthCalendarCellRenderer;
	if(cr != null)
		MonthCalendar calendar = cr.DropDownContainer.Controls[0] as MonthCalendar;
		calendar.MaxDate = new DateTime(2005, 8, 31);
		calendar.MinDate = new DateTime(2005, 7, 1);


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.