* DataGrid.cs: keep from going into an infinite loop redrawing a
authorChris Toshok <toshok@novell.com>
Thu, 30 Nov 2006 00:39:26 +0000 (00:39 -0000)
committerChris Toshok <toshok@novell.com>
Thu, 30 Nov 2006 00:39:26 +0000 (00:39 -0000)
datagrid that has no datasource.  Fixes bug #80033.

2006-11-29  Chris Toshok  <toshok@ximian.com>

svn path=/trunk/mcs/; revision=68719

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGrid.cs

index 18311a70afc30c82ce33aecb5e74ca460799b8b2..33091330053a2c46464dc61f34211d5d33f7939b 100644 (file)
@@ -1,3 +1,8 @@
+2006-11-29  Chris Toshok  <toshok@ximian.com>
+
+       * DataGrid.cs: keep from going into an infinite loop redrawing a
+       datagrid that has no datasource.  Fixes bug #80033.
+
 2006-11-29  Chris Toshok  <toshok@ximian.com>
 
        * MenuItem.cs: fix the NRE when we assign text (and therefore call
index 1c9570f4fb79bcd1c15c014a59b46dd4d3767481..11f65922a22ede5f352fddbc9e5e5df45ad3a913 100644 (file)
@@ -242,6 +242,7 @@ namespace System.Windows.Forms
                object datasource;
                string datamember;
                CurrencyManager list_manager;
+               bool refetch_list_manager = true;
                bool _readonly;
                DataGridRelationshipRow[] rows;
 
@@ -574,6 +575,7 @@ namespace System.Windows.Forms
                                        if (list_manager != null)
                                                list_manager = null;
                                        datamember = value;
+                                       refetch_list_manager = true;
                                }
                        }
                }
@@ -594,6 +596,7 @@ namespace System.Windows.Forms
 
                                        if (list_manager != null)
                                                list_manager = null;
+                                       refetch_list_manager = true;
                                }
                        }
                }
@@ -708,8 +711,10 @@ namespace System.Windows.Forms
                [EditorBrowsable(EditorBrowsableState.Advanced)]
                protected internal CurrencyManager ListManager {
                        get {
-                               if (list_manager == null)
+                               if (list_manager == null && refetch_list_manager) {
                                        SetDataSource (datasource, datamember);
+                                       refetch_list_manager = false;
+                               }
 
                                return list_manager;
                        }