[Mono-bugs] [Bug 448005] DataGridView.Rows.Clear() , bad index managment
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Mon Nov 24 18:02:54 EST 2008
https://bugzilla.novell.com/show_bug.cgi?id=448005
User jpobst at novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=448005#c3
Jonathan Pobst <jpobst at novell.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #3 from Jonathan Pobst <jpobst at novell.com> 2008-11-24 16:02:53 MST ---
Your test case fails on MS as well with an error box, so that isn't the way to
go.
One way to do it is what you had commented out:
DataSet Ds = (DataSet)DtGVFs.DataSource;
System.Data.DataTable dataTable1 = Ds.Tables[0];
dataTable1.Rows.Clear();
I added support for listening to the DataTable's TableCleared. However, this
currently won't work due to bug #448296. A workaround is to clear the table
instead of the table's Rows collection:
DataSet Ds = (DataSet)DtGVFs.DataSource;
System.Data.DataTable dataTable1 = Ds.Tables[0];
dataTable1.Clear();
Fixed in r119826. Thanks for the report!
2008-11-24 Jonathan Pobst <monkey at jpobst dot com>
* DataGridView.cs: Listen for a DataTable's TableCleared event so we
can clear ourselves when it is raised, we don't have a newrowindex
if we don't have any columns.
* DataGridViewRowCollection.cs: Ensure we always delete all the rows,
re-index after each delete so the NewRow will have the correct index.
[Fixes bug #448005]
2008-11-24 Jonathan Pobst <monkey at jpobst dot com>
* DataGridViewDataBindingTest.cs: Flush and add test for bug #448005.
* DataGridViewRowCollectionTest.cs: Add test for bug #448005.
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the mono-bugs
mailing list