Pārlūkot izejas kodu

2006-05-28 Chris Toshok <[email protected]>

	* CurrencyManager.cs (get_Current): after the late binding
	listposition = -1 fix, we need to guard against it here and return
	null, otherwise we raise an exception (which is swallowed
	elsewhere, and breaks datagrid databinding.)


svn path=/trunk/mcs/; revision=61218
Chris Toshok 19 gadi atpakaļ
vecāks
revīzija
35a572faed

+ 7 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog

@@ -1,3 +1,10 @@
+2006-05-28  Chris Toshok  <[email protected]>
+
+	* CurrencyManager.cs (get_Current): after the late binding
+	listposition = -1 fix, we need to guard against it here and return
+	null, otherwise we raise an exception (which is swallowed
+	elsewhere, and breaks datagrid databinding.)
+
 2006-05-26  Peter Dennis Bartok  <[email protected]>
 
 	* MenuAPI.cs (ProcessMenuKey): We can legally get msg types other

+ 2 - 2
mcs/class/Managed.Windows.Forms/System.Windows.Forms/CurrencyManager.cs

@@ -109,7 +109,7 @@ namespace System.Windows.Forms {
 
 		public override object Current {
 			get {
-				if (list.Count == 0)
+				if (list.Count == 0 || listposition == -1)
 					return null;
 				return list [listposition];
 			}
@@ -315,7 +315,7 @@ namespace System.Windows.Forms {
 
 		private void ListChangedHandler (object sender, ListChangedEventArgs e)
 		{
-			OnItemChanged (new ItemChangedEventArgs (-1));	
+			OnItemChanged (new ItemChangedEventArgs (-1));
 			UpdateIsBinding ();
 		}