Master Table : DtMaster
Detail Table : DtDetails
DataSet dataset = new DataSet();
dataset.Clear();
dataset.Tables.Add(DtMaster);
dataset.Tables.Add(DtDetails);
DataColumn keycolumn = dataset.Tables[0].Columns["JOB"];
DataColumn foreignkeycolumn = dataset.Tables[1].Columns["JOB"];
if (keycolumn != null && foreignkeycolumn != null)
{
dataset.Relations.Add("MasterDetailMap", keycolumn, foreignkeycolumn, false);
GridControlJobMonitor.DataSource = dataset.Tables[0];
GridControlJobMonitor.ForceInitialize();
}
I get the grid view as shown:
Where Order are grouped by Customer name. I used the RefreshHelperClass.cs
file from How to preserve the XtraGrid view state in multilevel master/detail to preserve and load the state. But after refresh I always get the first group in Detail View always expanded while second group always collapsed disregarding its previous condition. In my case I always get Group "Cust C2" always collapsed and group "Cust C1" always expanded.
How to resolve this condition?