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.

Problems with GridDataBoundGrid MonthCalendar CellType

Thread ID:

Created:

Updated:

Platform:

Replies:

70291 Dec 5,2007 10:17 AM Dec 6,2007 03:03 AM Windows Forms 2
loading
Tags: GridControl
Alexander Schlicht
Asked On December 5, 2007 10:17 AM

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


haneefm [Syncfusion]
Replied On December 5, 2007 02:21 PM

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


Alexander Schlicht
Replied On December 6, 2007 03:03 AM

Hi Haneef!

It works, thank you for your quick fix.

Alexander


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.

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.

;