A few days ago I looked at various solutions to enhance an exhisting DataList control at work.
The DataList brings back a fair bit of data from several different tables and seemed a bit bloated.
The first solution I looked at was data paging and only showing rows as needed. The DataList doesn’t come with built in Paging capabilities, so you’ll need to write your own. Scott Guthrie has a great post about Efficient Data Paging with the DataList control.
Although that is a great solution, in this current environment of Ajaxifying everything you can get your fingers upon I found a greatÂ open sourceÂ product named Ajax Data Controls (or ADC for short)Â and their DataList Paging example. You can download the controls from their CodePlex page.
The controlsÂ are basicallyÂ an AjaxifiedÂ replacement for the exhisting ASP.NET 2.0 Data Controls (GridView/DataList/Repeater), with a few minor differences.
One of the authors, Kazi Manzur RashidÂ has a great blog post on how to use their GridView control.
A third solution is to use theÂ PagedDataSource, which comes with ASP.NET 2.0. Sreejith Thathanattu has posted a goodÂ example ofÂ using theÂ PagedDataSourceÂ on CodeProject with the DataList. If you decide to go down this path, consider assigning a Cached version of your DataSource to PagedDataSource as that will help with performance (you’ll be hitting the Database less).