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. Image for the cookie policy date
close icon

MonthCalendar DateChanged Event

I need to handle the MonthCalendar DateChanged event for a MonthCalendar style cell. Is there an elegant solution?

I have tried handling the CurrentCellChanged but that doesn''t work as I require.

Thanks in advance.

1 Reply

AD Administrator Syncfusion Team September 5, 2006 09:10 AM UTC

Hi Jay,

You can access the GridDropDownMonthCalendarCellRenderer and can subscribe the MonthCalendar.DateChanged event to detect the date changes in the MonthCalendar cell. Below is a code snippet

GridDropDownMonthCalendarCellRenderer cr = this.grid.CellRenderers["MonthCalendar"] as GridDropDownMonthCalendarCellRenderer;
foreach(Control c in cr.DropDownContainer.Controls )
{
if( c is MonthCalendar )
{
MonthCalendar mc = c as MonthCalendar ;
mc.DateChanged +=new DateRangeEventHandler(mc_DateChanged);
break;
}
}

private void mc_DateChanged(object sender, DateRangeEventArgs e)
{
Console.WriteLine("DateChanged fired");
}

Thanks,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon