Home » Visual StudioRSS

DataGridView Default Error Dialog exception.

HI

When I add a new row, and then do bindingsource.rejectchanges(), for some reason I get this strange exception. The exception is not in a regular dialoge box, but a different one.  It says the following.

The following exception occured in teh DataGridView:

System.IndexOutOfRangeException: Index 28278 does not have a value.

at System.Windows.Forms.CurrencyManager.get_Item(Int32 Index)

at

System.Windows.Forms.DataGridView.DataGridViewDataConnection.GetError(Int32 RowIndex)

Any idea what could be causing it?

 

1 Answer Found

 

Answer 1

The following fixed teh  problem.

clientsDataGridView1.DataSource =

newBindingSource();

 

this.clientsDataGridView1.DataSource = this.clientsBindingSource;

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter