Is there a virtual listview for ASP.net?
Most tables (and grids, listview, data tables, data grids, grid views, list grids) i find for asp.net expect the user
I just make one virtual ListView sample.
I start with a repeater that I render divs, with an attribute that contain the Data Base id that need to be loaded.
loading...
Next the javascript that check if this div is visible, and get the data using ajax.
and here is my code behind as test that one
public partial class Dokimes_StackOverFlow_VirtualList : System.Web.UI.Page
{
List oMainIds = new List();
protected void Page_Load(object sender, EventArgs e)
{
for (int i = 0; i < 3000; i++)
oMainIds.Add(i);
Repeater1.DataSource = oMainIds;
Repeater1.DataBind();
}
public int GetID(object oItem){
return (int)oItem;
}
}
I tested and its working just find.
and here is the source code: http://www.planethost.gr/VirtualList.rar
Improvements that can be done:
Update I make some speed optimizing, and add ajax call test. For this optimizations work correct the height of the div that contains the data must be the same across the page. Left to load a group of data, get them as json and place them on the correct place.
http://www.planethost.gr/VirtualList2.rar