Author: husted
Date: Wed Nov  8 07:31:08 2006
New Revision: 472519

URL: http://svn.apache.org/viewvc?view=rev&rev=472519
Log:
Add AllowCustomPaging parameter to make changing the default easier.

Modified:
    struts/sandbox/trunk/overdrive/Nexus/Web/GridControl.ascx.cs

Modified: struts/sandbox/trunk/overdrive/Nexus/Web/GridControl.ascx.cs
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/overdrive/Nexus/Web/GridControl.ascx.cs?view=diff&rev=472519&r1=472518&r2=472519
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Web/GridControl.ascx.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Web/GridControl.ascx.cs Wed Nov  8 
07:31:08 2006
@@ -43,6 +43,12 @@
                        return criteria;
                }
 
+               protected IDictionary list_Criteria_NewPageIndex(IDictionary 
criteria, int pageIndex, bool allowCustomPaging)
+               {
+                       Grid.AllowCustomPaging = allowCustomPaging;
+                       return list_Criteria_NewPageIndex(criteria, pageIndex);
+               }
+
                /// <summary>
                /// If AllowCustomPage is set, 
                /// calculate new List and Offset, using the list_Context.
@@ -56,7 +62,7 @@
                protected IDictionary list_Criteria_NewPageIndex(int pageIndex)
                {
                        IDictionary criteria = list_Criteria;
-                       return list_Criteria_NewPageIndex(criteria, pageIndex);
+                       return list_Criteria_NewPageIndex(criteria, pageIndex, 
AllowCustomPaging);
                }
 
                /// <summary>
@@ -263,7 +269,7 @@
                        set { _HasEditColumn = value; }
                }
 
-               private bool _AllowCustomPaging = false;
+               private bool _AllowCustomPaging = true;
 
                public virtual bool AllowCustomPaging
                {
@@ -561,7 +567,7 @@
 
                        if ((Grid.AllowCustomPaging) && (criteria == null))
                        {
-                               list_Criteria_NewPageIndex(criteria, 0);
+                               list_Criteria_NewPageIndex(criteria, 0, true);
                                HasCriteria = true;
                        }
 
@@ -602,7 +608,7 @@
                public virtual bool Open(IDictionary criteria)
                {
                        Page_Reset();
-                       list_Criteria_NewPageIndex(criteria, 0);
+                       list_Criteria_NewPageIndex(criteria, 0, 
AllowCustomPaging);
                        return Open();
                }
 
@@ -879,6 +885,7 @@
                        ListPageIndexChanged_Raise(sender, e.NewPageIndex, 
grid.PageSize, count);
                        list_Refresh();
                }
+
 
                #endregion
 


Reply via email to