Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Option to cancel changes when moving to next record
 

Option to cancel changes when moving to next record

I have a form that shows one record at a time, with a navigator to move between them. The navigator and the fields on the form are bound to a BindingSource, which has a DataSet as its data source.

I also have a DataGridView on the form, which displays related records for the current 'master' record.

I would like the user to be able to make whatever changes they liked on the form and the details grid, but be prompted to save when moving to a new main record. I am aware of the CurrentChanged event on the binding source, but what I really want is a 'CurrentAboutToChange' event, that I can cancel if the user wants to stay on the current record and review their changes.

Any ideas? Thanks in advance.

jaspercat  Monday, March 05, 2007 9:09 PM

Currently, I am getting around the problem by deactivating the buttons on the navigator, and substituting my own handlers. This way, the user can be prompted before moving on to the next record. But it means I have to handle a lot of the navigator behaviour myself.

Surely there is a better way?

jaspercat  Tuesday, March 13, 2007 11:04 AM

Currently, I am getting around the problem by deactivating the buttons on the navigator, and substituting my own handlers. This way, the user can be prompted before moving on to the next record. But it means I have to handle a lot of the navigator behaviour myself.

Surely there is a better way?

jaspercat  Tuesday, March 13, 2007 11:04 AM

You can use google to search for other answers

Custom Search

More Threads

• Develop a insert statement using the values in a datagrid.
• DataGrid Sort Selections
• Adding, Saving information with BindingSource
• Can't Drag Table Onto DataGrid
• programmatically find a row in a DataGridView and select it
• Simple question about a bindingsource
• Binding on EndEdit reset datagrid!
• VB2005 Set focus to cell in new row in datagridview
• Adding a DataGridViewComboBox to DataGridView, using the value selected for calculations in Custom Column
• How to Add file path to gridview