* FormView.cs: init BottomPagerRow.ItemIndex with 0; gracefully handle null result...
authorAndrew Skiba <andrews@mono-cvs.ximian.com>
Sun, 30 Jul 2006 10:54:52 +0000 (10:54 -0000)
committerAndrew Skiba <andrews@mono-cvs.ximian.com>
Sun, 30 Jul 2006 10:54:52 +0000 (10:54 -0000)
svn path=/trunk/mcs/; revision=63158

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

index 5f061f1e7d34fcef7c6f5d9dcc8895a73873ca5c..9038f449add4f55c7aad45cd086cf46c4931210c 100644 (file)
@@ -1,3 +1,8 @@
+2006-07-30 Andrew Skiba <andrews@mainsoft.com>
+
+       * FormView.cs: init BottomPagerRow.ItemIndex with 0; gracefully
+       handle null result of GetData().
+
 2006-07-30 Andrew Skiba <andrews@mainsoft.com>
 
        * FormView.cs: use TableStyle for ControlStyle.
index a5322d16a897a380652475e0d99f2cf7aed7817c..5adf104a18fe4cd7b916fd5002d49b53a989ba8e 100644 (file)
@@ -904,7 +904,7 @@ namespace System.Web.UI.WebControls
                        }
                                
                        if (showPager && PagerSettings.Position == PagerPosition.Bottom || PagerSettings.Position == PagerPosition.TopAndBottom) {
-                               bottomPagerRow = CreateRow (-1, DataControlRowType.Pager, DataControlRowState.Normal);
+                               bottomPagerRow = CreateRow (0, DataControlRowType.Pager, DataControlRowState.Normal);
                                InitializePager (bottomPagerRow, dataSource);
                                table.Rows.Add (bottomPagerRow);
                        }
@@ -1255,7 +1255,8 @@ namespace System.Web.UI.WebControls
                        OnItemInserting (args);
                        if (!args.Cancel) {
                                DataSourceView view = GetData ();
-                               if (view == null) throw new HttpException ("The DataSourceView associated to data bound control was null");
+                               if (view == null) 
+                                       return;
                                view.Insert (currentEditNewValues, new DataSourceViewOperationCallback (InsertCallback));
                        } else
                                EndRowEdit ();