2014年7月13日 星期日

[RESOLVED] paging in datalist using list<>


Hi All,


I need to do paging next prev in datalist using List. Can anyone suggest the idea.


Here I found the paging with datatable:


http://www.mindfiresolutions.com/Paging-in-DataList-1699.php


Thanks




Hi radhekrishna,


Any particular reason you want to do Paging through list<>.


The best and easiest way is to go with PageDataSource as below:


//creating the PagedDataSource instance....
pg = new PagedDataSource();
pg.DataSource = myTable;
pg.AllowPaging = true;
pg.PageSize = 10;

//Binding pg to datalist
dl.DataSource = pg;//dl is datalist
dl.DataBind();

or else refer:



Hope this helps.


Thanks,


Jatin





Hi jatin,


since we are following three layer architecture with object factory. we nmust not use datables only lists<> we need to use and also imlicit declarations are only allowed in UI layer.


So thats why I asked for List<>. If you know please let me know. Anyways thanks for response.




Hi


You can give List as a datasource to datalist control. I hope paging can be performed with the code which you already have (embeded hyperlink in your post)



I would suggest you to use AspNetPager


You can easily design it. It has alot more option and do efficient, fasting paging. You just need to pass counter and set few basic setting than it start working


See Demo site


沒有留言:

張貼留言