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

What am I missing re: PageSizes?

1 Answer 26 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
C
Top achievements
Rank 1
C asked on 11 Dec 2013, 07:28 AM
I try to create a RadDataPager as such:

<telerik:RadDataPager runat="server" ID="ProductsListDataPager" PagedControlID="ProductsListView">
            <Fields>
                <telerik:RadDataPagerButtonField FieldType="FirstPrev" />
                <telerik:RadDataPagerButtonField FieldType="Numeric" />
                <telerik:RadDataPagerPageSizeField PageSizes="9,18,27,45" />
                <telerik:RadDataPagerButtonField FieldType="NextLast" />
            </Fields>
</telerik:RadDataPager>

But the PageSizeField line causes my page to crash, saying that I can't assign object[] to Int32[].

What am I doing wrong?

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 14 Dec 2013, 07:36 AM
Hello,

I have tested the provided code snippet on my end and everything is working as expected. Here is the code that I have tested with:
<telerik:RadListView ID="RadListView1" DataSourceID="SqlDataSource1" runat="server" AllowPaging="true"
    ItemPlaceholderID="ProductItemContainer" DataKeyNames="CategoryID">
    <LayoutTemplate>
        <fieldset>
            <legend>Products</legend>
            <asp:PlaceHolder ID="ProductItemContainer" runat="server"></asp:PlaceHolder>
        </fieldset>
    </LayoutTemplate>
    <ItemTemplate>
        <fieldset style="float: left; width: 250px; height: 75px">
            <legend>Category name:
                <%# Eval("CategoryName") %></legend>
            <%# Eval("Description")%>
        </fieldset>
    </ItemTemplate>
</telerik:RadListView>
 
<telerik:RadDataPager runat="server" ID="ProductsListDataPager" PagedControlID="RadListView1">
    <Fields>
        <telerik:RadDataPagerButtonField FieldType="FirstPrev" />
        <telerik:RadDataPagerButtonField FieldType="Numeric" />
        <telerik:RadDataPagerPageSizeField PageSizes="9,18,27,45" />
        <telerik:RadDataPagerButtonField FieldType="NextLast" />
    </Fields>
</telerik:RadDataPager>
 
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
    ProviderName="System.Data.SqlClient" SelectCommand="SELECT CategoryID, CategoryName, Description, Picture FROM Categories"></asp:SqlDataSource>

If you continue to face the issue, please elaborate on the RadControls version you are using, so we could try to reproduce the issue.


Regards,
Konstantin Dikov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
DataPager
Asked by
C
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or