I'm having difficulty expanding / selecting a specific detail table within a hierarchy grid. I have:
Plans [MasterTableView] >
Goals [DeatilsTableView] >
Objectives[DetailsTableView]
I need to select say only Objective 3 by its DataKey [as Im passing ObjectiveId via the querystring to this page]. I seem to be only able to expand all the objectives, when I need to just 'expand to' or 'show selected' whatever ObjectiveId row... Here's my function...am I even close...or is there an easier way? protected void ExpandToObjectives()
{
string sObjectiveId = Request.QueryString["ObjectiveId"].ToString();
RadGrid1.MasterTableView.HierarchyDefaultExpanded = true;
foreach (GridTableView gtv in RadGrid1.MasterTableView.DetailTables)
{
if (gtv.Name == "Goals")
{
foreach (GridTableView gtv1 in gtv.DetailTables)
{
if (dataItem.GetDataKeyValue("ObjectiveId").ToString() == sObjectiveId)
dataItem.Selected = true;
}
}
}
}
Plans [MasterTableView] >
Goals [DeatilsTableView] >
Objectives[DetailsTableView]
I need to select say only Objective 3 by its DataKey [as Im passing ObjectiveId via the querystring to this page]. I seem to be only able to expand all the objectives, when I need to just 'expand to' or 'show selected' whatever ObjectiveId row... Here's my function...am I even close...or is there an easier way? protected void ExpandToObjectives()
{
string sObjectiveId = Request.QueryString["ObjectiveId"].ToString();
RadGrid1.MasterTableView.HierarchyDefaultExpanded = true;
foreach (GridTableView gtv in RadGrid1.MasterTableView.DetailTables)
{
if (gtv.Name == "Goals")
{
foreach (GridTableView gtv1 in gtv.DetailTables)
{
if (dataItem.GetDataKeyValue("ObjectiveId").ToString() == sObjectiveId)
dataItem.Selected = true;
}
}
}
}