Okay, I know I'm missing something here. I'm using the latest version of Rad for WinForms (Q1 2008) and I'm trying to populate a RadGridView using code only (not the BindingSource control). Can you tell me why this code isn't working?
private void PopulateGrid()
{
DataSet ds = GetMasterDetail();
radGridView1.DataSource = ds;
}
private DataSet GetMasterDetail()
{
DataTable master = Clients.GetMasterList();
master.TableName = "Clients";
DataTable child = Orders.GetChildList();
child.TableName = "Orders";
DataSet ds = new DataSet();
ds.Tables.Add(master.Copy());
ds.Tables.Add(child.Copy());
DataRelation relationship = new DataRelation("MasterDetail", ds.Tables["Clients"].Columns["ClientID"], ds.Tables["Orders"].Columns["ClientID"]);
ds.Relations.Add(relationship);
return ds;
}
Why does iterating through the rows in the grid take so long like in this example. It can take a few minutes to walk through every row in the grid if it contains 10000+ rows. Is there a more efficient way to walk the rows. I am trying to implement a find within a column functionality, but it is extremely slow for a large number of rows.
for (int i = 0; i < Global.MainUiForm.OutputGrid.RowCount; i++)
{
currentRow =
Global.MainUiForm.OutputGrid.MasterGridViewInfo.Rows[i];
radColumn = (
RadColumn)this.comboBoxLookIn.SelectedItem;
if (regex.IsMatch(currentRow.Cells[radColumn.FieldName].Value.ToString()))
{
currentRow.IsCurrent =
true;
currentRow.EnsureVisible();
currentRow.Cells[radColumn.FieldName].EnsureVisible();
found =
true;
break;
}
}