i would like to develop a hierarchical grid view programmatically. The firstrow(masterTableview) im adding it at design time.
Im doing that using the code below, but its not adding the griddesignview(children for the first row) Does anyone see whats wrong with the code im using here:
Master.ParentlocationID is matched to TableView.LocationID, im also using a dataset as my datasource.
adapter.Fill(dsData);
GridTableView tableSubLocation = new GridTableView(rdgLocation);
rdgLocation.MasterTableView.DetailTables.Add(tableSubLocation);
tableSubLocation.DataSource = dsData;
tableSubLocation.Width =
Unit.Percentage(100);
GridRelationFields relationFields = new GridRelationFields();
tableSubLocation.ParentTableRelation.Add(relationFields);
relationFields.MasterKeyField =
"LocationID";
relationFields.DetailKeyField =
"ParentLocationID";
GridBoundColumn boundColumn;
boundColumn =
new GridBoundColumn();
tableSubLocation.Columns.Add(boundColumn);
boundColumn.DataField =
"LocationID";
boundColumn.HeaderText =
"LocationID";
boundColumn =
new GridBoundColumn();
tableSubLocation.Columns.Add(boundColumn);
boundColumn.DataField =
"Location";
boundColumn.HeaderText =
"Location";