Jun 05, 2009, 12:06 PM
[CLOSED] GridView wrong number of records displayed
I have a page set up like this:
both grids have the PageSize set to 100 but both display 11 records.
The first one says: Displaying 1 - 11 of 11
and the second one: Displaying 1 - 11 of 27
and none of them shows multiple pages.
I checked and the two methods return proper data from the DB, including the out int count param.
So, I guess somewhere along the way the two params are confused.
<asp:ObjectDataSource ID="dsUserVisits" runat="server" SelectMethod="GetUserVisits" TypeName="Access" OnSelected="dsUserVisits_Selected">
<SelectParameters>
<asp:Parameter Name="Start" Type="Int32" DefaultValue="0" />
<asp:Parameter Name="Limit" Type="Int32" DefaultValue="100" />
<asp:Parameter Name="SortField" />
<asp:Parameter Name="SortDir" />
<asp:Parameter Name="count" Direction="Output" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<ext:Store ID="sUserVisits" runat="server" AutoLoad="true" RemoteSort="true" DataSourceID="dsUserVisits" OnRefreshData="sUserVisits_RefreshData">
<AutoLoadParams>
<ext:Parameter Name="start" Value="={0}" />
<ext:Parameter Name="limit" Value="={100}" />
</AutoLoadParams>
<Proxy>
<ext:DataSourceProxy />
</Proxy>
<Reader>
<ext:JsonReader ReaderID="ID">
<Fields>
<ext:RecordField Name="UserName" />
<ext:RecordField Name="Customer" />
<ext:RecordField Name="Visits" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
<asp:ObjectDataSource ID="dsIpVisits" runat="server" SelectMethod="GetIpVisits" TypeName="Access" OnSelected="dsIpVisits_Selected">
<SelectParameters>
<asp:Parameter Name="Start" Type="Int32" DefaultValue="0" />
<asp:Parameter Name="Limit" Type="Int32" DefaultValue="100" />
<asp:Parameter Name="SortField" />
<asp:Parameter Name="SortDir" />
<asp:Parameter Name="count" Direction="Output" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<ext:Store ID="sIpVisits" runat="server" AutoLoad="true" RemoteSort="true" DataSourceID="dsIpVisits" OnRefreshData="sIpVisits_RefreshData">
<AutoLoadParams>
<ext:Parameter Name="start" Value="={0}" />
<ext:Parameter Name="limit" Value="={100}" />
</AutoLoadParams>
<Proxy>
<ext:DataSourceProxy />
</Proxy>
<Reader>
<ext:JsonReader ReaderID="ID">
<Fields>
<ext:RecordField Name="IpAddress" />
<ext:RecordField Name="UserName" />
<ext:RecordField Name="Customer" />
<ext:RecordField Name="Visits" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
<ext:BorderLayout runat="server">
<North MarginsSummary="0 0 0 0">
<ext:Panel runat="server" Height="300" Border="false">
<Body>
<ext:ColumnLayout runat="server" Margin="5" FitHeight="true">
<ext:LayoutColumn ColumnWidth=".5">
<ext:GridPanel runat="server" ID="gridUserVisits" Height="300" StoreID="sUserVisits" Title="#Visits per User#">
<ColumnModel runat="server">
<Columns>
<ext:Column ColumnID="UserName" DataIndex="UserName" Header="#User Name#" />
<ext:Column ColumnID="Customer" DataIndex="Customer" Header="#Customer#" />
<ext:Column ColumnID="Visits" DataIndex="Visits" Header="#Visits#" />
</Columns>
</ColumnModel>
<BottomBar>
<ext:PagingToolBar ID="UserVisitsPagination" runat="server" StoreID="sUserVisits" PageSize="100" DisplayMsg="#Displaying {0} - {1} of {2}#"
FirstText="#First Page#" PrevText="#Previous Page#" NextText="#Next Page#" LastText="#Last Page#" RefreshText="#Refresh#" >
<Plugins>
<ext:SlidingPager runat="server">
<GetText Fn="function(s){return s.value}" />
</ext:SlidingPager>
</Plugins>
</ext:PagingToolBar>
</BottomBar>
<LoadMask ShowMask="true" Msg="#Loading...#" />
</ext:GridPanel>
</ext:LayoutColumn>
<ext:LayoutColumn ColumnWidth=".5">
<ext:GridPanel runat="server" ID="gridIpVisits" Height="300" StoreID="sIpVisits" Title="#Visits per Ip#">
<ColumnModel runat="server">
<Columns>
<ext:Column ColumnID="IpAddress" DataIndex="IpAddress" Header="#Ip Address#" />
<ext:Column ColumnID="UserName" DataIndex="UserName" Header="#User Name#" />
<ext:Column ColumnID="Customer" DataIndex="Customer" Header="#Customer#" />
<ext:Column ColumnID="Visits" DataIndex="Visits" Header="#Visits#" />
</Columns>
</ColumnModel>
<BottomBar>
<ext:PagingToolBar ID="IpVisitsPagination" runat="server" StoreID="sIpVisits" PageSize="100" DisplayMsg="#Displaying {0} - {1} of {2}#"
FirstText="#First Page#" PrevText="#Previous Page#" NextText="#Next Page#" LastText="#Last Page#" RefreshText="#Refresh#" >
<Plugins>
<ext:SlidingPager runat="server">
<GetText Fn="function(s){return s.value}" />
</ext:SlidingPager>
</Plugins>
</ext:PagingToolBar>
</BottomBar>
<LoadMask ShowMask="true" Msg="#Loading...#" />
</ext:GridPanel>
</ext:LayoutColumn>
</ext:ColumnLayout>
</Body>
</ext:Panel>
</North>
<Center MarginsSummary="5 0 0 0">
<ext:Panel runat="server" Height="300">
<Body>
</Body>
</ext:Panel>
</Center>
</ext:BorderLayout>
the GetUserVisits method returns 11 records and the GetIpVisits method returns 27 recordsboth grids have the PageSize set to 100 but both display 11 records.
The first one says: Displaying 1 - 11 of 11
and the second one: Displaying 1 - 11 of 27
and none of them shows multiple pages.
I checked and the two methods return proper data from the DB, including the out int count param.
So, I guess somewhere along the way the two params are confused.