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

Cell editing in GDBG

Hi, I need the following behavior when editing a cell: 1. When clicking on a cell (single click and hold), I want the cell to become editable. Currently, the cell become editable only when I''m pressing F2 or when I simply try to type in the cell. Any way to cause it become editable when clicking with a mouse? 2. When I exit a cell, I want to detect if the cell content has been changed. I tried to call few properties, but it didn''t work. What is the correct why to detect cell changes? 3. How can I cancel cell changes (it''s actually undo)? I have a logical condition, and if the condition is failed, I want to undo the changes, restore the old value, and exit the edit mode for the current cell? How can I do it? (I tried to call "CancelEdit", "RejectChanges", but none of these has worked?!) Thanks in advance, Gil K

3 Replies

AD Administrator Syncfusion Team July 26, 2004 03:17 PM UTC

1) Try this setting: this.gridControl1.ActivateCurrentCellBehavior = Syncfusion.Windows.Forms.Grid.GridCellActivateAction.ClickOnCell; 2) Normally, you would use the CurrentCellValidating event to validate changes in a cell. It is only raised if the cell has changed. 3) If you set e.Cancel = true in CurrentCellValidating, the grid will not let your user leave the cell. To get the new value in CurrentCellValidating to test, you can use grid.CurrentCell.Renderer.ControlText.

AD Administrator Syncfusion Team October 25, 2005 03:05 PM UTC

Is there the same kind of think for the GGC ? In fact I need to make the content of a cell editable and keep the rest of the row not editable. Thanks in advance.

AD Administrator Syncfusion Team October 25, 2005 03:10 PM UTC

If you never want the other cells to get focus, you can try setting grid.TableDescriptor.Columns["ColName"].Appearance.AnyRecordFieldCell.Enabled = false; for all those columns. This should not let your user click any of these cells.

Live Chat Icon For mobile
Up arrow icon