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

Datapager with ListBox

4 Answers 91 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Luffy
Top achievements
Rank 1
Luffy asked on 04 Jul 2011, 06:59 PM
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

4 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 07 Jul 2011, 09:19 AM
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!

0
Luffy
Top achievements
Rank 1
answered on 08 Jul 2011, 07:53 AM
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
0
Luffy
Top achievements
Rank 1
answered on 08 Jul 2011, 08:02 AM
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>
0
Iana Tsolova
Telerik team
answered on 08 Jul 2011, 02:50 PM
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!

Tags
DataPager
Asked by
Luffy
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Luffy
Top achievements
Rank 1
Share this question
or