We're using 2010 Q3 and running into some issues when attempting a hierarchical grid.
This code is based on the demo. The issue is the expand won't show the child records / table when the arrow beside a parent record is clicked. Nothing happens. No error.
Here is some sample code.
private void DefineGridStructure()
{
/* Hierarchy Grid - lab and test types for each lab */
RadGrid oRadGridLab = new RadGrid();
oRadGridLab.ID = "TelRadGridLab";
var oLaboratories
= (from p in this.Core.EntityModel.Laboratories
select p).ToList();
oRadGridLab.DataSource = oLaboratories;
oRadGridLab.DataMember = "Laboratory";
oRadGridLab.MasterTableView.DataKeyNames = new string[] { "Idn" };
oRadGridLab.Skin = "Office2007";
oRadGridLab.Width = Unit.Percentage(98);
oRadGridLab.PageSize = 3;
oRadGridLab.AllowPaging = true;
oRadGridLab.AllowSorting = true;
oRadGridLab.PagerStyle.Mode = GridPagerMode.NumericPages;
oRadGridLab.AutoGenerateColumns = false;
//oRadGridLab.MasterTableView.GroupLoadMode = GridGroupLoadMode.Client;
oRadGridLab.MasterTableView.PageSize = 3;
//Add columns
GridBoundColumn boundColumn;
boundColumn = new GridBoundColumn();
boundColumn.DataField = "Idn";
boundColumn.HeaderText = "Idn";
oRadGridLab.MasterTableView.Columns.Add(boundColumn);
boundColumn = new GridBoundColumn();
boundColumn.DataField = "Name";
boundColumn.HeaderText = "Name";
oRadGridLab.MasterTableView.Columns.Add(boundColumn);
oRadGridLab.DataBind();
//Detail table - Test Types (II in hierarchy level)
GridTableView oTableViewTestTypes = new GridTableView(oRadGridLab);
var oTestTypes
= (from p in this.Core.EntityModel.TestTypeToLaboratories
select p).ToList();
oTableViewTestTypes.DataSource = oTestTypes;
oTableViewTestTypes.DataMember = "TestTypeToLaboratory";
oTableViewTestTypes.Width = Unit.Percentage(100);
oTableViewTestTypes.DataKeyNames = new string[] { "Idn" };
GridRelationFields relationFields = new GridRelationFields();
relationFields.MasterKeyField = "Idn";
relationFields.DetailKeyField = "LaboratoryIdn";
oTableViewTestTypes.ParentTableRelation.Add(relationFields);
oRadGridLab.MasterTableView.DetailTables.Add(oTableViewTestTypes);
//Add columns
boundColumn = new GridBoundColumn();
boundColumn.DataField = "LaboratoryIdn";
boundColumn.HeaderText = "LaboratoryIdn";
oTableViewTestTypes.Columns.Add(boundColumn);
boundColumn = new GridBoundColumn();
boundColumn.DataField = "CreatedOn";
boundColumn.HeaderText = "CreatedOn";
oTableViewTestTypes.Columns.Add(boundColumn);
boundColumn = new GridBoundColumn();
boundColumn.DataField = "ModifiedOn";
boundColumn.HeaderText = "ModifiedOn";
oTableViewTestTypes.Columns.Add(boundColumn);
oTableViewTestTypes.DataBind();
//Add the RadGrid instance to the controls
this.AspPlaceHolder.Controls.Add(oRadGridLab);
}
Thank you in advance for your assistance and considerations.