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.
Syncfusion Feedback

DateCellQueryInfo event in GGC?

Thread ID:

Created:

Updated:

Platform:

Replies:

51588 Nov 9,2006 03:34 AM UTC Nov 9,2006 11:55 AM UTC Windows Forms 1
loading
Tags: Grouping
Michael Lorenz
Asked On November 9, 2006 03:34 AM UTC

Hi,

I was wondering if it's possible to trap the DateCellQueryInfo event from a GridGroupingControl? I have a couple of columns that are of the MonthCalendar type, and I'd like to trap this event so that I can remove all dates prior to the current date from the calendar. For a regular MonthCalendarAdv control I have something like:

private void Calendar_DateCellQueryInfo(object sender, DateCellQueryInfoEventArgs e) {

if (dt < ((MonthCalendarAdv)sender).MinValue || dt > ((MonthCalendarAdv)sender).MaxValue || dt.DayOfWeek == DayOfWeek.Saturday || dt.DayOfWeek == DayOfWeek.Sunday) {
e.Style.CellValue = null;
}

}

Can this also be done from the calendar dropdown in the GGC? If so, can you please post a code snippet showing how this is accomplished?

Thanks,
Michael

Administrator [Syncfusion]
Replied On November 9, 2006 11:55 AM UTC

Hi Michael,

The Grid's MonthCalendar celltype implements the System.Windows.MonthCalender control in DropDownContainer of the cell. It doesn't implement the Syncfusion.Windows.Tools.MonthCalendarAdv control in a DropDownContainer of the cell. You can use the GridDropDownMonthCalendarCellRenderer to acess the MonthCalendar control in a cell. Here is a code snippet

GridDropDownMonthCalendarCellRenderer cr = this.gridGroupingControl1.TableControl.CellRenderers["MonthCalendar"] as GridDropDownMonthCalendarCellRenderer;
foreach(Control c in cr.DropDownContainer.Controls)
{
if( c is MonthCalendarAdv )
{
MonthCalendar cCalendar = c as MonthCalendar;
//you can use the any event from here....
//cCalendar.DateChanged....
}
}

If you want to implement the MonthCalendarAdv control in a cell, you need to create the custom celltypes. Please try the attached sample which implements the MonthCalendarAdv in a cell and let me know if you are looking something different.

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/DateTimeCell_3cebccd9.zip

Best Regards,
Haneef

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

;