Hi,
i want to develop a hierarchy grid with pragmatically Binding using DetailTableDataBind Event in this i have different tables and based on id i may get different structured tables with different columns how can i bind these tables to GridTableView in Telerik please help in this aspect
am using this code for DetailTableDataBind Event
i want to develop a hierarchy grid with pragmatically Binding using DetailTableDataBind Event in this i have different tables and based on id i may get different structured tables with different columns how can i bind these tables to GridTableView in Telerik please help in this aspect
am using this code for DetailTableDataBind Event
protected void Rgrid_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
{
GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
int PNameID = Convert.ToInt16(dataItem.GetDataKeyValue("PNameID"));
try
{
Common ObjCommon = new Common();
DataSet ds = ObjCommon.DocumentsWithFields(PNameID);
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
e.DetailTableView.Columns.Clear();
e.DetailTableView.DataSource= ds.Tables[0];
}
}
else
{
var PropertyDocs = (ObjCommon .DocumentsWithoutFields(PNameID)).ToList();
e.DetailTableView.DataSource = PropertyDocs;
}
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
above code return correct table structure but not binding to Gridtable view