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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridDataBoundGrid behavior

Thread ID:

Created:

Updated:

Platform:

Replies:

12076 Mar 22,2004 04:53 AM UTC Mar 22,2004 09:06 AM UTC WinForms 1
loading
Tags: GridControl
Ionut Balas
Asked On March 22, 2004 04:53 AM UTC

I have a DataBoundGrid and a BoundColumn in the grid. I set the CellType of the column to MonthCalendar. I wish the CurrentCell to let me modify the data only from the MonthCalendar control (only when I push the button). I need these behavior because when I have a cell selected and I press any key on the keyboard the data cell changes and I get a error message: " ... is not a valid value for the DateTime", where "..." is the text in the cell. Thank you.

Administrator [Syncfusion]
Replied On March 22, 2004 09:06 AM UTC

One way you can prevent the cell from editing is to handle teh CurrentCellStartEditing event and set e.Cancel = true. I think you will also have to hand CurrentCellCloseDropdown and call CurrentCell.ConfirmChanges to make the selcted date show up in th ecell before you leave teh cell. Here are some snippets.
private void gridDataBoundGrid1_CurrentCellStartEditing(object sender, CancelEventArgs e)
{
	GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
	if(this.gridDataBoundGrid1[cc.RowIndex, cc.ColIndex].CellType == "MonthCalendar")
		e.Cancel = true;
}
private void gridDataBoundGrid1_CurrentCellCloseDropDown(object sender, Syncfusion.Windows.Forms.PopupClosedEventArgs e)
{
	if(e.PopupCloseType == Syncfusion.Windows.Forms.PopupCloseType.Done)
		this.gridDataBoundGrid1.CurrentCell.ConfirmChanges();
}

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

;