Hi,

Attached for review is a patch that implement UpdateRowHeightInfo method
in DataGridView class. Previously threw a NotImplementedException.


Also, it would be great If someone could review (and commit if it's OK)
the patch attached to this bug report (slight change in DataGridView
calling OnDataGridViewChanged to match .NET behavior):

https://bugzilla.novell.com/show_bug.cgi?id=481681

Thanks,
Tom

Index: class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs
===================================================================
--- class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs	(revision 125609)
+++ class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs	(working copy)
@@ -3028,8 +3028,31 @@
 				InvalidateRow (i);
 		}
 
-		public void UpdateRowHeightInfo (int rowIndex, bool updateToEnd) {
-			throw new NotImplementedException();
+		public void UpdateRowHeightInfo (int rowIndex, bool updateToEnd) 
+		{
+			if (rowIndex < 0 && updateToEnd)
+				throw new ArgumentOutOfRangeException ("rowIndex");
+			if (rowIndex < -1 && !updateToEnd)
+				throw new ArgumentOutOfRangeException ("rowIndex");
+			if (rowIndex >= Rows.Count)
+				throw new ArgumentOutOfRangeException ("rowIndex");
+
+			if (updateToEnd)
+			{
+				for (int i = rowIndex; i < Rows.Count; i++)
+					OnRowHeightInfoNeeded (new DataGridViewRowHeightInfoNeededEventArgs(i, Rows[i].Height, Rows[i].MinimumHeight));
+			}
+			else
+			{	
+				int height = 0;
+				int minimumHeight = 0;
+				if (rowIndex > -1)
+				{
+					height = Rows[rowIndex].Height;
+					minimumHeight = Rows[rowIndex].MinimumHeight;
+				} 
+				OnRowHeightInfoNeeded (new DataGridViewRowHeightInfoNeededEventArgs(rowIndex, height, minimumHeight));
+			}			
 		}
 
 		protected override bool CanEnableIme {
_______________________________________________
Mono-winforms-list maillist  -  Mono-winforms-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list

Reply via email to