Bugzilla – Attachment 270550 Details for
Bug 472968
DataGridViewRowCollection.Insert is broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
Fix
dgv-rowc-insert.patch (text/plain), 5.28 KB, created by
Forgotten User CRPsQFwJ3b
on 2009-02-05 18:29:40 UTC
(
hide
)
Description:
Fix
Filename:
MIME Type:
Creator:
Forgotten User CRPsQFwJ3b
Created:
2009-02-05 18:29:40 UTC
Size:
5.28 KB
patch
obsolete
>commit 9fbaf54a09a2b9211090beb8ea98569e72f9c60c >Author: Ivan N. Zlatev <contact@i-nz.net> >Date: Thu Feb 5 18:20:04 2009 +0000 > > 2009-02-05 Ivan N. Zlatev <contact@i-nz.net> > > * DataGridViewRowCollection.cs, DataGridView.cs: Fix row insertation: > - Use ArrayList.Insert instead of the Item property so that the item > is actually inserted and not an existing item replaced. > - Call DataGridView.OnRowsAddedInternal and drop internal from > OnRowsAdded for binary compitability. This also fixes several > redrawing issues. > [Fixes bug #472968] > >diff --git a/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog >index eb0f389..a27dead 100644 >--- a/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog >+++ b/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog >@@ -1,3 +1,13 @@ >+2009-02-05 Ivan N. Zlatev <contact@i-nz.net> >+ >+ * DataGridViewRowCollection.cs, DataGridView.cs: Fix row insertation: >+ - Use ArrayList.Insert instead of the Item property so that the item >+ is actually inserted and not an existing item replaced. >+ - Call DataGridView.OnRowsAddedInternal and drop internal from >+ OnRowsAdded for binary compitability. This also fixes several >+ redrawing issues. >+ [Fixes bug #472968] >+ > 2009-02-05 Andrés G. Aragoneses <aaragoneses@novell.com> > > * ToolBarButton.cs: Doh, fire OnUIATextChanged *after* setting >diff --git a/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs b/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs >index fa23e0b..5a67275 100644 >--- a/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs >+++ b/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs >@@ -4836,7 +4836,7 @@ namespace System.Windows.Forms { > OnRowsAdded (e); > } > >- protected internal virtual void OnRowsAdded (DataGridViewRowsAddedEventArgs e) >+ protected virtual void OnRowsAdded (DataGridViewRowsAddedEventArgs e) > { > DataGridViewRowsAddedEventHandler eh = (DataGridViewRowsAddedEventHandler)(Events [RowsAddedEvent]); > if (eh != null) eh (this, e); >diff --git a/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs b/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs >index 6445f56..e46dffc 100644 >--- a/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs >+++ b/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs >@@ -198,7 +198,7 @@ namespace System.Windows.Forms > int result = 0; > for (int i = 0; i < count; i++) > result = Add (dataGridView.RowTemplateFull as DataGridViewRow); >- DataGridView.OnRowsAdded (new DataGridViewRowsAddedEventArgs (result - count + 1, count)); >+ DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (result - count + 1, count)); > raiseEvent = true; > return result; > } >@@ -223,7 +223,7 @@ namespace System.Windows.Forms > int lastIndex = 0; > for (int i = 0; i < count; i++) > lastIndex = AddCopy(indexSource); >- DataGridView.OnRowsAdded (new DataGridViewRowsAddedEventArgs (lastIndex - count + 1, count)); >+ DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (lastIndex - count + 1, count)); > raiseEvent = true; > return lastIndex; > } >@@ -246,7 +246,7 @@ namespace System.Windows.Forms > lastIndex = Add (row); > count++; > } >- DataGridView.OnRowsAdded (new DataGridViewRowsAddedEventArgs (lastIndex - count + 1, count)); >+ DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (lastIndex - count + 1, count)); > raiseEvent = true; > } > >@@ -404,10 +404,11 @@ namespace System.Windows.Forms > dataGridViewRow.SetIndex (rowIndex); > dataGridViewRow.SetDataGridView (dataGridView); > CompleteRowCells (dataGridViewRow); >- list[rowIndex] = dataGridViewRow; >+ list.Insert (rowIndex, dataGridViewRow); >+ ReIndex (); > OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, dataGridViewRow)); > if (raiseEvent) >- DataGridView.OnRowsAdded (new DataGridViewRowsAddedEventArgs (rowIndex, 1)); >+ DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (rowIndex, 1)); > } > > public virtual void Insert (int rowIndex, int count) >@@ -416,7 +417,7 @@ namespace System.Windows.Forms > raiseEvent = false; > for (int i = 0; i < count; i++) > Insert (index++, dataGridView.RowTemplateFull); >- DataGridView.OnRowsAdded (new DataGridViewRowsAddedEventArgs (rowIndex, count)); >+ DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (rowIndex, count)); > raiseEvent = true; > } > >@@ -437,7 +438,7 @@ namespace System.Windows.Forms > int index = indexDestination; > for (int i = 0; i < count; i++) > InsertCopy (indexSource, index++); >- DataGridView.OnRowsAdded (new DataGridViewRowsAddedEventArgs (indexDestination, count)); >+ DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (indexDestination, count)); > raiseEvent = true; > } > >@@ -455,7 +456,7 @@ namespace System.Windows.Forms > Insert (index++, row); > count++; > } >- DataGridView.OnRowsAdded (new DataGridViewRowsAddedEventArgs (rowIndex, count)); >+ DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (rowIndex, count)); > raiseEvent = true; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 472968
:
270515
|
270516
|
270519
|
270532
|
270536
| 270550