Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataGridView EndEdit() problem
Message
From
25/06/2007 13:05:19
Jeff Corder
Ambit Technologies, LLC
Missouri, United States
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
DataGridView EndEdit() problem
Miscellaneous
Thread ID:
01235401
Message ID:
01235401
Views:
83
I have a mmDataGridView with AllowUserToAddRow = True. It is bound to InvoicesItems which is a child of the primary table Invoices.

When I open the form, the Invoices business object is populated. No changes are made to the InvoicesItems business Object. I close the form and I get an error: There is no row at position 0

When I follow the error, I end up in mmBusinessForm.EndEdit(). When it calls EndEdit() on the individual rows for InvoicesItems, it gets a Position = 0 from this.BindingContext[...].Position, but there is are no rows in the table. When it calls dt.Rows[0].EndEdit() it throws an error because there is no row at position 0.

It looks like the Grid is reporting its position at row 0 because that is where the cursor is and data will be entered. But, since data has not been entered, no row has been created.

Any suggestions on solving this dilemma?

Thanks,
Jeff
Next
Reply
Map
View

Click here to load this message in the networking platform