Dear Telerik Team,
I have a requirement [ Hierarchical grid ] where the detail table [ Leaf ] content will change according to the row value. ie, if the row field value is "contract", the detail table should take value from contract table, and if the row field value is "phase", the detail table should take value from phase table etc.
Below I give the code sample I have done,
I have a requirement [ Hierarchical grid ] where the detail table [ Leaf ] content will change according to the row value. ie, if the row field value is "contract", the detail table should take value from contract table, and if the row field value is "phase", the detail table should take value from phase table etc.
Below I give the code sample I have done,
protected
void RadGrid1_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e)
{
int
wbsLevelID = Convert.ToInt32(dataItem.GetDataKeyValue("wbsLevelID").ToString());
string
wbsLevelCode = dataItem.GetDataKeyValue("wbsLevelCode").ToString();
if
(wbsLevelCode == "Category" && wbsLevelID!=0)
{
DataTable
dtSource = (DataTable)e.DetailTableView.DataSource;
e.DetailTableView.DataSource = GetContractRowDataTable(dtSource, wbsLevelID);
}
}
public
DataTable GetContractRowDataTable(DataTable dtSource, int categoryID,int wbsLevelID)
{
///////// I want to define columns and add rows from here.
}
//////////////////////////////
Will this logic work?
Please help me in this scenario.
Thanks