Hi pgokke,
The Virtual DataGridView is (almost) identical to use as the standard DataGridView, except for the fact that you will need to register it in web.config in the controls section to be able to use it, and then to fully use it's potential, you set UseInternalPaging = False.
The following code works fine, after you have dropped a VirtualDataGridView on a form and registered it in web.config:
private void Form2_Load(object sender, EventArgs e)
{
virtualDataGridView1.UseInternalPaging = false;
virtualDataGridView1.DataSource = Utils.BuildDatatable(3, 100000);
}
Where the BuildTable is declared with this code:
public static DataTable BuildDatatable(int intCols, int intRows)
{
DataTable DT = new DataTable();
for (int i = 1; i <= intCols; i++)
{
DT.Columns.Add("Col" + i.ToString());
}
for (int i = 1; i <= intRows; i++)
{
DataRow DR = DT.NewRow();
for (int j = 1; j <= intCols; j++)
{
DR["Col" + j.ToString()] = j.ToString();
}
DT.Rows.Add(DR);
}
return DT;
}
This sample populates the VirtualDataGridView with 100 thoushand rows in a DataTable, and the longest delay you get is while creating the rows. After the rows have been created, you have a very powerful and well performing grid with 100 thousand rows in single page as it seems.
Hope this helps,
Palli