Hi.
I'm not sure if im doing something wrong, but assuming this example:
http://demos.telerik.com/silverlight/#GridView/Performance
with 1000000 rows, 5 columns.
I need to load 2500 records with 8 to 10 columns and doing it like:
1st attempt to load data: using class product:
using (SqlConnection conn = new SqlConnection(cString.c_String))
{
conn.Open();
SqlCommand cmd = new SqlCommand(sqlCommand, conn);
rdr = cmd.ExecuteReader();
while (rdr.Read())
{
-- Product p =new Product {.....};
myGrid.Add(p);
}
Second attempt:
SqlDataAdapter sd = new SqlDataAdapter(new SqlCommand(sqlCommand, conn));
DataTable dt = new DataTable();
sd.Fill(dt);
dg.ItemsSource = dt.DefaultView;
Second is little bit faster i guess, but still tooks much time to load.
I have also tested only window loading time and it took ~1sec to load (only window, with listview with items from db)
Unfortunately with gridView it tooks 5 to 10 sec.
Question is:
Is there any way to (for example) load only first 50 records, and when i scroll down load more?
Or maybe there's example for gridView (WPF!) paging ?
Thanks for answer,
Adam.
I'm not sure if im doing something wrong, but assuming this example:
http://demos.telerik.com/silverlight/#GridView/Performance
with 1000000 rows, 5 columns.
I need to load 2500 records with 8 to 10 columns and doing it like:
1st attempt to load data: using class product:
using (SqlConnection conn = new SqlConnection(cString.c_String))
{
conn.Open();
SqlCommand cmd = new SqlCommand(sqlCommand, conn);
rdr = cmd.ExecuteReader();
while (rdr.Read())
{
-- Product p =new Product {.....};
myGrid.Add(p);
}
Second attempt:
SqlDataAdapter sd = new SqlDataAdapter(new SqlCommand(sqlCommand, conn));
DataTable dt = new DataTable();
sd.Fill(dt);
dg.ItemsSource = dt.DefaultView;
Second is little bit faster i guess, but still tooks much time to load.
I have also tested only window loading time and it took ~1sec to load (only window, with listview with items from db)
Unfortunately with gridView it tooks 5 to 10 sec.
Question is:
Is there any way to (for example) load only first 50 records, and when i scroll down load more?
Or maybe there's example for gridView (WPF!) paging ?
Thanks for answer,
Adam.