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

GridGroupingControl Cell = "Control"

Hi,
I''ve customerized DataTimePickerAdv for
column in the GridGroupingControl.
Here is part the code:

DateTimeePickerAdv dateTimePicker = new DateTimePickerAdv();
dateTimePicker.ShowDropButton = false;
dateTimePicker.ShowUpDown = true;
dateTimePicker.ShowCheckBox = false;
dateTimePicker.Format = DateTimePickerFormat.Custom;
dateTimePicker.CustomFormat = fmt;

GridTableDescriptor td = ggcControl.TableDescriptor;

GridColumnDescriptor cd = td.GetColumnDescriptor(columnName);

cd.Appearance.AnyRecordFieldCell.Format = "HH:mm";

cd.Appearance.AnyRecordFieldCell.Control = dateTimePicker;
dd.Appearance.AnyRecordFieldCell.CellType = "Control";
cd.Appearance.AnyRecordFieldCell.CellValueType = typeof(DateTime);

I found two problems (or bugs)
1) It does not poppulate the correct time value
And two row (I only two rows in the table)
always show the same values.

2) Whenever I changed one row to some other time
say 11:33 to 12:56,
the other row will automatically get updated
to the 12:56

Did you miss anything or this is a known bug.

1 Reply

AD Administrator Syncfusion Team July 21, 2006 11:22 AM UTC

Hi Ken,

To have a DataTimePicker in the grid, a custom cell control has to be created that is derived from the GridStaticCellModel and the GridStaticCellRenderer. The custom model thus created can be added through gridGroupingControl1.TableModel.CellModels collection.
Please refer the sample link below, that demonstrates the way you could implement this with the gridgroupingcontrol.

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

Let me know if you need any further assistance.
Regards,
Rajagopal

Loader.
Live Chat Icon For mobile
Up arrow icon