Hi,
I am trying to use radGridView to display large amount of data records (200,000+ records). The radGridView just hangs and load it for a long time. How do I make it so that radGridview can display the data as it loads the rest of the data (like the SQL server management studio). Thank you in advance for your help.
I've the sample code below:
private bool BindToDataReader(string query)
{
this.radGridView1.MasterGridViewTemplate.AllowAddNewRow = false;
this.radGridView1.MasterGridViewTemplate.AutoGenerateColumns = true;
this.radGridView1.MasterGridViewTemplate.EnableGrouping = true;
this.radGridView1.GridElement.BeginUpdate();
SqlCommand command = new SqlCommand(query);
command.CommandTimeout = 0;
command.Connection = new SqlConnection(_strConnection);
try
{
command.Connection.Open();
this.radGridView1.MasterGridViewTemplate.LoadFrom(command.ExecuteReader());
command.Connection.Close();
for (int i = 0; i < radGridView1.MasterGridViewTemplate.Columns.Count; i++)
{
this.radGridView1.MasterGridViewTemplate.Columns[i].Width = 102;
}
this.radGridView1.GridElement.EndUpdate();
}
catch (Exception ex){
objLogger.Trace(ex.StackTrace.ToString() + Environment.NewLine + ex.Message.ToString());
return false;
}
return true;
}
I am trying to use radGridView to display large amount of data records (200,000+ records). The radGridView just hangs and load it for a long time. How do I make it so that radGridview can display the data as it loads the rest of the data (like the SQL server management studio). Thank you in advance for your help.
I've the sample code below:
private bool BindToDataReader(string query)
{
this.radGridView1.MasterGridViewTemplate.AllowAddNewRow = false;
this.radGridView1.MasterGridViewTemplate.AutoGenerateColumns = true;
this.radGridView1.MasterGridViewTemplate.EnableGrouping = true;
this.radGridView1.GridElement.BeginUpdate();
SqlCommand command = new SqlCommand(query);
command.CommandTimeout = 0;
command.Connection = new SqlConnection(_strConnection);
try
{
command.Connection.Open();
this.radGridView1.MasterGridViewTemplate.LoadFrom(command.ExecuteReader());
command.Connection.Close();
for (int i = 0; i < radGridView1.MasterGridViewTemplate.Columns.Count; i++)
{
this.radGridView1.MasterGridViewTemplate.Columns[i].Width = 102;
}
this.radGridView1.GridElement.EndUpdate();
}
catch (Exception ex){
objLogger.Trace(ex.StackTrace.ToString() + Environment.NewLine + ex.Message.ToString());
return false;
}
return true;
}