What am I missing re: PageSizes?

2 posts, 0 answers
  1. C
    C avatar
    43 posts
    Member since:
    Jul 2013

    Posted 11 Dec 2013 Link to this post

    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?
  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1793 posts

    Posted 14 Dec 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top