Calendar cells restricting dates . .

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

1 Reply

AD Administrator Syncfusion Team July 26, 2005 10:12 PM UTC

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);
	}
}

Loader.
Up arrow icon