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

Problems with GridDataBoundGrid MonthCalendar CellType

Hello!

I have some Problems with the MonthCalendar CellTypes in a GridDataBoundGrid. In V5.2 it was posible to edit the value by typing a new date over keyboard and after leaving or pressing enter this value ist stored in the DataTable. In V6.1 only Values are saved by choosing it from the DropDown Calendar. When I type a Value by keybard an press Enter the Old value is stored. This phenomenon is also in the Syncfusion samples for CellTypes, what's happen?

Alexander


2 Replies

HA haneefm Syncfusion Team December 5, 2007 07:21 PM UTC

Hi Schlicht,

This can be solved by handling the CurrentCellEditingComplete event of the grid and accordingly set the currentcell value. The following is the code snippet.

void gridDataBoundGrid1_CurrentCellEditingComplete(object sender, EventArgs e)
{
GridDataBoundGrid _grid = sender as GridDataBoundGrid;
GridCurrentCell cc = _grid.CurrentCell;
if (cc.HasCurrentCell && cc.Renderer is GridDropDownMonthCalendarCellRenderer)
{
DateTime RendererDate;
if (DateTime.TryParse(cc.Renderer.ControlText, out RendererDate))
{
_grid.Model[cc.RowIndex, cc.ColIndex].CellValue = RendererDate;
_grid.CurrentCell.EndEdit();
_grid.Binder.EndEdit();
}
}
}

Best regards,
Haneef



AS Alexander Schlicht December 6, 2007 08:03 AM UTC

Hi Haneef!

It works, thank you for your quick fix.

Alexander


Loader.
Live Chat Icon For mobile
Up arrow icon