@{
var ChildGrid1 = new Syncfusion.EJ2.Grids.Grid()
{
DataSource = ViewBag.empData,
QueryString = "EmployeeID",
EditSettings = new Syncfusion.EJ2.Grids.GridEditSettings() { AllowAdding = true, AllowEditing = true, AllowDeleting = true },
Toolbar = new List<string>() { "Add", "Edit", "Delete", "Update", "Delete" },
Aggregates = new List<Syncfusion.EJ2.Grids.GridAggregate> {
new Syncfusion.EJ2.Grids.GridAggregate() {Columns =col} },
Columns = new List<Syncfusion.EJ2.Grids.GridColumn> {
new Syncfusion.EJ2.Grids.GridColumn(){ Field="orderid", HeaderText="ID", IsPrimaryKey=true, Width="200" },
new Syncfusion.EJ2.Grids.GridColumn(){ Field="id", ForeignKeyField="EmployeeID1", ForeignKeyValue="FullName", DataSource= ViewBag.empData1, HeaderText="Full Name", Width="200" },
}
};
}
=============================================
<ejs-grid id="PublishedGrid" dataSource="ViewBag.data" childGrid="ChildGrid1" allowPaging="true" gridLines="Both">
<e-grid-pagesettings pageSize="10"></e-grid-pagesettings>
<e-grid-editSettings allowAdding="false" allowDeleting="false" allowEditing="false" showDeleteConfirmDialog="true" showConfirmDialog="true"></e-grid-editSettings>
<e-grid-textwrapsettings wrapMode="Both"></e-grid-textwrapsettings>
<e-grid-columns>
<e-grid-column field="OrderID" isIdentity="true" isPrimaryKey="true" width="180" textAlign="Right" visible="true"></e-grid-column>
<e-grid-column field="EmployeeID" headertext="HReadable" width="150"></e-grid-column>
</e-grid-columns>
</ejs-grid> |