This is a migrated thread and some comments may be shown as answers.

[Solved] Problem with Server Side Paging

1 Answer 175 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ilem
Top achievements
Rank 1
ilem asked on 13 Apr 2009, 12:21 PM
Hello, I have a RadGrid with a pageSize = 10 and i used a Server Side Paging to retrieve my data. The problem is when the radgrid had the values startRowIndex = 10 and MaximumRows = 10 from the objectDatasource, it show just one record in the Page 2. In the other Pages it's ok. Here is my Code :
<telerik:RadGrid ID="gdvGC_0007" ShowStatusBar="True" 
                        runat="server" AllowPaging="True" AllowCustomPaging="True" AllowSorting="True" 
                        GridLines="None" Width="98%" Skin="Gray" AutoGenerateColumns="False" MasterTableView-DataKeyNames="ListID" 
                        DataSourceID="odsListGeneric" Visible="False" OnItemDataBound="GridViews_ItemDataBound" OnItemCreated="GridViews_ItemCreated"
                        <HeaderContextMenu Skin="Web20"
                            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                        </HeaderContextMenu> 
                        <MasterTableView Width="100%">                                                      
                            <Columns> 
                                <telerik:GridBoundColumn DataField="ElementValue" HeaderText="English" SortExpression="En_DName" /> 
                                <telerik:GridBoundColumn DataField="ElementValueFr" HeaderText="French" SortExpression="Fr_DName" /> 
                                <telerik:GridBoundColumn DataField="ElementValueSp" HeaderText="Spanish" SortExpression="Sp_DName" /> 
                                <telerik:GridBoundColumn DataField="Reserved" HeaderText="Reserved" Visible="false" /> 
                                <telerik:GridTemplateColumn> 
                                    <ItemTemplate> 
                                        <asp:RadioButton ID="rdSelect" runat="server" AutoPostBack="True" OnCheckedChanged="rdSelect_CheckedChanged" /> 
                                    </ItemTemplate> 
                                </telerik:GridTemplateColumn> 
                            </Columns> 
                        </MasterTableView> 
                        <ClientSettings> 
                            <Selecting AllowRowSelect="True"></Selecting> 
                        </ClientSettings> 
                        <FilterMenu Skin="Web20"
                            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                        </FilterMenu> 
                        <PagerStyle Mode="NextPrevAndNumeric" /> 
                    </telerik:RadGrid> 
<asp:ObjectDataSource ID="odsListGeneric" runat="server" EnablePaging="True" TypeName="elementUIC" 
                        SelectMethod="SelectTriElements" SelectCountMethod="getRecordCount" SortParameterName="sortParameter" 
                        StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maximumRows" 
                        DataObjectTypeName="CElement" OldValuesParameterFormatString="original_{0}"
                        <SelectParameters> 
                            <asp:Parameter Direction="Output" Name="myRowsCount" Type="Int32" /> 
                            <asp:QueryStringParameter DbType="Int32" QueryStringField="LvGroupID" Name="LvGroupID" /> 
                            <asp:QueryStringParameter DbType="String" QueryStringField="Element" Name="Element" /> 
                        </SelectParameters> 
                    </asp:ObjectDataSource> 

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 14 Apr 2009, 07:18 AM
Hello ilem,

There are certain behaviors of a grid that works with ObjectDataSource that are implemented in .NET 2.0 concerning paging - to be more precise, when given the page size, the grid can mine the datasource for ONLY that amount of data.
For more information about custom paging, please refer to the following articles:
Custom paging
Custom paging through ObjectDataSource population

Sincerely yours,
Pavlina
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
ilem
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or