Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > BindingSource.EndEdit not pushing changes?
 

BindingSource.EndEdit not pushing changes?

Hello all:

C#.Net 2.0 Windows Forms project. I have a DataGridView bound to a BindingSource which pulls from a DataTable in a dataset.

In the CellValidating event of the DataGridView I call:

((BindingSource)((DataGridView)sender).DataSource).EndEdit();

this.pushUpdates();

The this.pushUpdates() procedure tests the DataSet for changes and runs updates as needed.

Let’s say we have cells A, B, C and D in the grid. If I tab from A to B and then add a value, when I tab out of B and into C debugging shows that the CellValidating event fires for cell B and the procedures are called. But the DataSet shows no changes.

When I tab from C to D THEN the DataSet shows changes and pushed them. Why is this? Anyone know?

Thanks

Kurt

Kurt Wimberger  Friday, September 25, 2009 4:28 PM
Oh, never mind. I have my order of events wrong. I can call .EndEdit on the BindingSource in CellValidating but can call pushUpdates in CellEndEdit. That does it.

Thanks
Kurt Wimberger  Friday, September 25, 2009 4:40 PM
Oh, never mind. I have my order of events wrong. I can call .EndEdit on the BindingSource in CellValidating but can call pushUpdates in CellEndEdit. That does it.

Thanks
Kurt Wimberger  Friday, September 25, 2009 4:40 PM

You can use google to search for other answers

Custom Search

More Threads

• Bindingsource AddingNew causes "Cannot add external objects to this list"
• Refilling a datagridview with fewer Col
• Re: Weird Listbox SelectedIndices error when using Data Bound from a MS Access Database Table
• Datagridview tooltip from database
• add new record in the binding datasource using BindingManagerBase.AddNew() method
• Binding custom objects to Data Grids
• ... cannot be set on a data-bound DataGridView control
• Records in datareader
• Any Comprehensive C#/ADO.NET Samples out there?
• Sync a combo and a datagridview