Datapager with ListBox

5 posts, 0 answers
  1. Luffy
    Luffy avatar
    28 posts
    Member since:
    Jun 2011

    Posted 04 Jul 2011 Link to this post

    I have some issue putting a datapager to a list box. Following below is my code
    <telerik:RadDataPager ID="RadDataPager1" runat="server" PagedControlID="RadListBox1">
     </telerik:RadDataPager>
     
      <telerik:RadListBox ID="RadListBox1" runat="server" AutoPostBack="True"
                                                    DataKeyField="EventLocation" DataSourceID="Listbox"
                                                    DataTextField="EventLocation" DataValueField="EventLocation"
                                                    DlisataKeyField="EventLocation" Skin="Black" allowpaging="true"
                                                    style="z-index: 1; left: 1109px; top: 114px; position: absolute; height: 48px; width: 155px; text-align: center;"> <ButtonSettings TransferButtons="All" />
        </telerik:RadListBox>

    When i run my aspx page, it doesnt show any paging
  2. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 07 Jul 2011 Link to this post

    Hi Sherman,

    For the RadDataPager to display something, you should add some fields to it. Find more information below:
    http://www.telerik.com/help/aspnet-ajax/datapager-elements.html
    http://demos.telerik.com/aspnet-ajax/datapager/examples/firstlook/defaultcs.aspx

    Kind regards,
    Iana
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Luffy
    Luffy avatar
    28 posts
    Member since:
    Jun 2011

    Posted 08 Jul 2011 Link to this post

    Hi there,

    I have added the fields its just that when i run my program, the listbox display the list of info whereas the Datapager only display a row of white line seperated from the listbox
  5. Luffy
    Luffy avatar
    28 posts
    Member since:
    Jun 2011

    Posted 08 Jul 2011 Link to this post

    I will show some the codes and screenshot that i've done. 

    <telerik:RadDataPager ID="RadDataPager1" runat="server"
                                               PagedControlID="RadListBox2" Height="40px" Width="196px">
                            <Fields>           
       <telerik:RadDataPagerButtonField FieldType="FirstPrev" FirstButtonText="First" PrevButtonText="Prev" />
       <telerik:RadDataPagerButtonField FieldType="Numeric" PageButtonCount="5" />
       <telerik:RadDataPagerButtonField FieldType="NextLast" NextButtonText="Next" LastButtonText="Last" />
                           </Fields
                                         </telerik:RadDataPager>
                                          
                                           <telerik:RadListBox ID="RadListBox2" runat="server" AutoPostBack="True"
                                               DataKeyField="EventCategory" DataSourceID="SqlDataSource3"
                                               DataTextField="EventCategory" DataValueField="EventCategory"
                                               DlisataKeyField="EventLocation" Skin="Black"
                                                
                                               style="z-index: 1; left: 44px; top: 86px; position: absolute; height: 48px; width: 155px; text-align: center;">
                                               <ButtonSettings TransferButtons="All" />
                                           </telerik:RadListBox>
  6. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 08 Jul 2011 Link to this post

    Hello Sherman,

    I am not sure if you sent the proper image. However you should note that RadDataPager can automatically page control which implement the IPageableItemContainer or IRadPageableItemContainer interface. Or pageable DataSource control is bound to the pager (like LinqDataSource and EntityDataSource).
    So to use the DataPager in your case, you should handle the PageIndexChanged event and manually set the new page index to the RadListBox and rebind it. Similar is done in this demo.

    Try it out and let me know if you need further assistance.

    Best wishes,
    Iana
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017