Product Bundles
DevCraft
All Telerik .NET and Kendo UI JavaScript components and AI Tools in one package.
Kendo UI
Bundle of AI Tools plus four JavaScript UI libraries built natively for jQuery, Angular, React and Vue.
Build JavaScript UI
Javascript
Telerik
Build modern .NET business apps
.Net Web
Cross-Platform
Desktop
Reporting and Documents
AI for Developers & IT
Ensure AI program success
AI Coding
AI Engineering
Additional Tools
Enhance the developer and designer experience
Testing & Mocking
Debugging
AI-Enhanced UI Tools
CMS
Free Tools
Support and Learning
Productivity and Design Tools
private void DefineGridStructure() { RadGrid RadGrid1 = new RadGrid(); RadGrid1.ID = "RadGrid1"; RadGrid1.MasterTableView.DataKeyNames = new string[] { "CustomerID" }; RadGrid1.MasterTableView.Name = "Customers"; //Add columns //Detail table - Orders (II in hierarchy level) GridTableView tableViewOrders = new GridTableView(RadGrid1); tableViewOrders.Name = "Orders"; // Name of the child grid tableViewOrders.DataKeyNames = new string[] { "OrderID" }; GridRelationFields relationFields = new GridRelationFields(); relationFields.MasterKeyField = "CustomerID"; relationFields.DetailKeyField = "CustomerID"; tableViewOrders.ParentTableRelation.Add(relationFields); RadGrid1.MasterTableView.DetailTables.Add(tableViewOrders); //Add columns boundColumn = new GridBoundColumn(); boundColumn.DataField = "OrderID"; boundColumn.HeaderText = "OrderID"; boundColumn.UniqueName = "OrderID"; tableViewOrders.Columns.Add(boundColumn); } void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridDataItem && e.Item.OwnerTableView.Name == "Orders") //Name of child grid { GridDataItem dataItem = (GridDataItem)e.Item; TableCell cell = dataItem["OrderID"];//Accessing Cell value of Detail Table using UniqueName string itemValue = dataItem["OrderID"].Text; } }
private
void
DefineGridStructure()
{
RadGrid RadGrid1 =
new
RadGrid();
RadGrid1.ID =
"RadGrid1"
;
RadGrid1.MasterTableView.DataKeyNames =
string
[] {
"CustomerID"
};
RadGrid1.MasterTableView.Name =
"Customers"
//Add columns
//Detail table - Orders (II in hierarchy level)
GridTableView tableViewOrders =
GridTableView(RadGrid1);
tableViewOrders.Name =
"Orders"
// Name of the child grid
tableViewOrders.DataKeyNames =
"OrderID"
GridRelationFields relationFields =
GridRelationFields();
relationFields.MasterKeyField =
relationFields.DetailKeyField =
tableViewOrders.ParentTableRelation.Add(relationFields);
RadGrid1.MasterTableView.DetailTables.Add(tableViewOrders);
boundColumn =
GridBoundColumn();
boundColumn.DataField =
boundColumn.HeaderText =
boundColumn.UniqueName =
tableViewOrders.Columns.Add(boundColumn);
}
RadGrid1_ItemDataBound(
object
sender, GridItemEventArgs e)
if
(e.Item
is
GridDataItem && e.Item.OwnerTableView.Name ==
)
//Name of child grid
GridDataItem dataItem = (GridDataItem)e.Item;
TableCell cell = dataItem[
];
//Accessing Cell value of Detail Table using UniqueName
itemValue = dataItem[
].Text;