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

Emulate Google Images search results pagination w/ ListView and RadDataPager

1 Answer 47 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Esteban
Top achievements
Rank 1
Esteban asked on 03 May 2012, 05:14 PM
Hi,

I am currently working on a Media Library module for a CMS. Reading a folder in the file system I bind the results to a RadListView that has a PageSize of n (12 at the moment) in order to display its content: images.

DirectoryInfo di = new DirectoryInfo(MediaLibPath);
FileSystemInfo[] files = di.GetFiles();
var fileByUploadedDate = files.OrderByDescending(f => f.CreationTime);
ResourceLV.DataSource = files;
ResourceLV.DataBind();

In the RadDataPager I have a RadButton with the OnClick

ResourceLV.PageSize += 12;
ReloadResourceListView();

ReloadResourceListView() rebinds the ListView. Very similar to this sample:

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/customizingpager/defaultcs.aspx 


What I am trying to avoid is rebind every time as there could be hundreds of images in the folder being
read. Is it possible to have the PageSize increase sort of like google images search results.
What would your suggestion be? What about the PageSize from Grid, could that be emulated too?

Thanks






1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 07 May 2012, 08:09 PM
Hello Esteban,

The only way to append items to RadListView without rebinding the whole control is to use it with client-side binding which allows appending data to an already bound listview. You can see a sample implementation here:
http://demos.telerik.com/aspnet-ajax/listview/examples/client/appendingdata/defaultcs.aspx

All the best,
Tsvetina
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
Esteban
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or