This is in regard to paging not working in Hirarchial rad grid in the detail table. all i have is one master table and 2 nested tables inside it. I have done custom paging for Master table view and want to use default paging for the nested table. However when i try to move to page 2 in detail table, it is unable to bind as it looks for its source in need data source event where i only have binded it to master table and have set datasource for details table in the DetailTableDataBind event.
protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
if (!e.IsFromDetailTable)
{
RadGrid1.DataSource = GetGridData();
}
}
protected void RadGrid1_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
{
GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
switch (e.DetailTableView.Name)
{
case "Element":
{
string CustomerID = dataItem.GetDataKeyValue("CustomerID").ToString();
e.DetailTableView.DataSource = GetDataTable(
"Element", CustomerID);
break;
}
case "Criteria":
{
string OrderID = dataItem.GetDataKeyValue("OrderID").ToString();
e.DetailTableView.DataSource = GetDataTable(
"Criteria", OrderID);
break;
}
}
}
public DataTable GetDataTable(string Type, String Id)
{
DataSet myDataSet;
DataTable myResultsView = new DataTable();
if (Type == "Element")
{
myDataSet = aw.sn.
GetElementListByUnit.ExecuteDataSet (dbConnString,Convert.ToInt32(Id));
myResultsView = myDataSet.Tables[0];
}
if (Type == "Criteria")
{
myDataSet = aw.sn.
GetCriteriaListByElement.ExecuteDataSet(dbConnString, Convert.ToInt32(Id), isignpostId);
myResultsView = myDataSet.Tables[0];
}
return myResultsView;
}
Please help..
Many Thanks
Ash