Author: husted
Date: Fri Oct 28 13:10:52 2005
New Revision: 329281

URL: http://svn.apache.org/viewcvs?rev=329281&view=rev
Log:
OVR-21
* Raise page-index-changed event more than once per request, if needed.

Modified:
    struts/sandbox/trunk/overdrive/Nexus/Web/GridControl.ascx.cs
    struts/sandbox/trunk/overdrive/PhoneBook/Core/Messages.resx
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.cs

Modified: struts/sandbox/trunk/overdrive/Nexus/Web/GridControl.ascx.cs
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Web/GridControl.ascx.cs?rev=329281&r1=329280&r2=329281&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Web/GridControl.ascx.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Web/GridControl.ascx.cs Fri Oct 28 
13:10:52 2005
@@ -374,14 +374,14 @@
                {
                        // Only bind columns once
                        // WARNING: Won't work with a singleton
+                       DataGrid grid = Grid;
+                       int count = (helper.Outcome).Count; 
                        if (bind)
                        {
                                bind = false;
                                int i = 0;
                                if (HasEditColumn) i = BindEditColumn(i);
                                if (HasItemColumn) i = BindItemColumn(i);
-                               int count = (helper.Outcome).Count; 
-                               DataGrid grid = Grid;
                                if (AllowCustomPaging)
                                {
                                        count = GetItemCount(helper);
@@ -389,11 +389,11 @@
                                        grid.VirtualItemCount = count;
                                }
                                BindColumns(i);
-                               ListPageIndexChanged_Raise(this, 
-                                       grid.CurrentPageIndex,
-                                       grid.PageSize,
-                                       count);
                        }
+                       ListPageIndexChanged_Raise(this, 
+                               grid.CurrentPageIndex,
+                               grid.PageSize,
+                               count);
                        DataSource(helper);
                        DataBind();
                }

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Core/Messages.resx
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Core/Messages.resx?rev=329281&r1=329280&r2=329281&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Core/Messages.resx (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Core/Messages.resx Fri Oct 28 
13:10:52 2005
@@ -40,6 +40,9 @@
                <value>System.Resources.ResXResourceWriter, 
System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089</value>
        </resheader>
        
+       <data name="page_index_hint">
+               <value>Viewing {0}-{1} of {2}.</value>
+       </data> 
 
     <!-- command labels -->
 

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx?rev=329281&r1=329280&r2=329281&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx 
(original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx Fri Oct 
28 13:10:52 2005
@@ -1,4 +1,5 @@
 <%@ Control Language="c#" AutoEventWireup="false" Codebehind="Lister2.ascx.cs" 
Inherits="PhoneBook.Web.Controls.Lister2" 
TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
+<asp:Label ID="hint" Runat="server"></asp:Label>
 <asp:DataGrid id="list" Runat="server" AutoGenerateColumns=False
        PageSize="2" AllowPaging="true" PagerStyle-Mode="NumericPages">
        <HeaderStyle CssClass="HeaderStyle" BackColor="#CCCC99"></HeaderStyle>

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.cs
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.cs?rev=329281&r1=329280&r2=329281&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.cs 
(original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.cs Fri 
Oct 28 13:10:52 2005
@@ -76,6 +76,24 @@
                }
 
                /// <summary>
+               /// Provide a runtime instance of the label over the DataGrid.
+               /// </summary>
+               /// 
+               public Label hint;
+
+               /// <summary>
+               /// Update the page index hint. 
+               /// </summary>
+               /// <param name="sender">Event source</param>
+               /// <param name="e">Runtime parameters</param>
+               /// 
+               private void this_ListPageIndexChanged(object sender, EventArgs 
e)
+               {
+                       ListPageIndexChangedArgs a = e as 
ListPageIndexChangedArgs;
+                       hint.Text = ListPageIndexChanged_Message(a);
+               }
+
+               /// <summary>
                /// Handle Page Init event by obtaining the user profile 
                /// and initalizing the controls.
                /// </summary>
@@ -84,6 +102,7 @@
                {
                        Grid = list;
                        Grid_Init();
+                       this.ListPageIndexChanged += new 
EventHandler(this_ListPageIndexChanged);
                }
 
                /// <summary>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to