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

RadDatapager with Asp Datalist

1 Answer 151 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Kutbuddin
Top achievements
Rank 1
Kutbuddin asked on 19 Nov 2011, 02:14 PM
<div class="product-grid">
<asp:DataList ID="dlProducts" runat="server" RepeatColumns="2" RepeatDirection="Horizontal"
RepeatLayout="Table" ItemStyle-CssClass="item-box">
<ItemTemplate>
<nopCommerce:ProductBox1 ID="ctrlProductBox" Product='<%#Container.DataItem%>'
runat="server" />
</ItemTemplate>
</asp:DataList>
</div>
<div class="clear">
</div>
<div class="product-pager">
<telerik:RadDataPager ID="RadDataPager1" runat="server" PagedControlID="dlProducts">
            <Fields>
                <telerik:RadDataPagerButtonField FieldType="FirstPrev" />
                <telerik:RadDataPagerButtonField FieldType="Numeric" />
                <telerik:RadDataPagerButtonField FieldType="NextLast" />
                <telerik:RadDataPagerGoToPageField />
                <telerik:RadDataPagerNumericPageSizeField />
                <telerik:RadDataPagerSliderField />
            </Fields>
        </telerik:RadDataPager>
</div>



please help me how can i use raddatapager with asp datalist ???

i tried this but its not working
???

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 22 Nov 2011, 09:47 AM
Hello Kutbuddin,

The ASP:DataList controls implements neither the IPageableItemContainer nor the IRadPageableItemContainer interfaces. That is why you cannot use RadDataPager to page it directly by simply setting the RadDataPager PagedControlID.
However you can implement paging in a similar manner as it is done in this demo. The main points here are:
- you need to handle the OnTotalRowCountRequest event of the RadDataPager and there set the TotalRowCount;
- you need to handle the PageIndexchanged event of the RadDataPager. The you need to assign the new DataSource for the DataList and call its DataBind method so it is populated with the data for the new page.

Additionally, to use the RadDataPager control with no code, you can implement your data visualization though ASP:ListView or RadListView. See the below demos for more information:
http://demos.telerik.com/aspnet-ajax/datapager/examples/firstlook/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/datapager/examples/raddatapagervsdatapager/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/listview/examples/firstlook/defaultcs.aspx


Regards,
Iana Tsolova
the Telerik team
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 their blog feed now
Tags
DataPager
Asked by
Kutbuddin
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or