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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

When to save changes in a non-dbgrid

Thread ID:





6387 Aug 11,2003 05:31 PM UTC Aug 11,2003 08:42 PM UTC WinForms 1
Tags: GridControl
Asked On August 11, 2003 05:31 PM UTC

I have a grid (non-databound) that I'm manually populating from a DB. I want to save changes back to the DB at the appropriate time...essentially, when a cell has changed and we've moved to a new row, or the grid has lost focus. What event would be the best to handle my save routine? I don't want to save back to the DB everytime a cell is changed. ALSO, How do I best duplicate the datbound grid's behavior of undoing a given row's changes: ex., change cell 2 in row 3, then change cell 3 in row 3, then hit escape, reverts cell 3, hit escape again, reverts the row. BUT.... change cell 2, row 3, move to row 4, change cell 3, 1st escape key changes cell 3 back, but 2nd does nothing. Eric

Administrator [Syncfusion]
Replied On August 11, 2003 08:42 PM UTC

If you want this GridDataBoundGrid-like behavior, it might be simpler to use the GridDataBoundGrid. You can use the CurrentCellMoved (or CurrentCellMoving) event to decide when you are changing rows. You can test grid.CurrentCell.MoveToRow and grid.CurrentCell.MoveFromRow to decide whether you are changing rows. To handle the Esc requirement, I think you will have to buffer the old values for the changes on a row. You can use the same CurrentCellMoved event to decide when you want to reset your buffer. You can use, maybe CurrentCellValiding to populate your buffer. You could handle CurrentCellKeyDown to catch the Esc key to undo your changes. You could set a flag to track whether you get 2 escapes back to back for teh same row.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon