* FormView.cs: init DataKeys and fix null reference.
authorAndrew Skiba <andrews@mono-cvs.ximian.com>
Sun, 30 Jul 2006 08:01:58 +0000 (08:01 -0000)
committerAndrew Skiba <andrews@mono-cvs.ximian.com>
Sun, 30 Jul 2006 08:01:58 +0000 (08:01 -0000)
svn path=/trunk/mcs/; revision=63151

mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
mcs/class/System.Web/System.Web.UI.WebControls/FormView.cs

index 2af0d93322bcc9397480e6f6b00eb30bb32113e7..4ad268dbac057d3358f6983e18c405c0809c7312 100644 (file)
@@ -1,3 +1,7 @@
+2006-07-30 Andrew Skiba <andrews@mainsoft.com>
+
+       * FormView.cs: init DataKeys and fix null reference.
+
 2006-07-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * TreeView.cs: several changes to improve compatibility with MS.
index cbbcf47e07e6f0a90702973b8c2683b1a8b1086c..26ec848c9467ca91ad8801bc04b50b7161b00c09 100644 (file)
@@ -105,7 +105,8 @@ namespace System.Web.UI.WebControls
                int pageCount = 0;
                
                public FormView ()
-               {
+               {\r
+                       key = new DataKey (new OrderedDictionary ());\r
                }
                
                public event EventHandler PageIndexChanged {
@@ -1006,7 +1007,10 @@ namespace System.Web.UI.WebControls
                }
                
                protected virtual void ExtractRowValues (IOrderedDictionary fieldValues, bool includeKeys)
-               {
+               {\r
+                       if (Row == null)\r
+                               return;
+
                        DataControlRowState rowState = Row.RowState;
                        IBindableTemplate bt;