public IActionResult Index()
{
ViewBag.dataSource = OrdersDetails.GetAllRecords().ToList();
List<TabTabItem> tabItems = new List<TabTabItem>();
tabItems.Add(new TabTabItem { Header = new TabHeader { Text = "Grid1" }, Content = "#Content1" });
tabItems.Add(new TabTabItem { Header = new TabHeader { Text = "Grid2" }, Content = "#Content2" });
ViewBag.items = tabItems;
return View();
} |
@using Syncfusion.EJ2.Navigations;
<div class="e-content">
<div id="Content1" style="display: none">
<ejs-grid id="ej2grid" dataSource="@ViewBag.DataSource" allowResizing="true" allowPaging="true" allowPdfExport="true" allowSorting="true" allowGrouping="true" allowFiltering="true" enableAltRow="true" allowExcelExport="true" gridLines="None" rowHeight="35" height="310">
<e-grid-pagesettings pageCount="5" pageSizes="true"></e-grid-pagesettings>
<e-grid-columns>
<e-grid-column field="OrderID" headerText="Order ID" isPrimaryKey="true" textAlign="Right" width="100"></e-grid-column>
<e-grid-column field="CustomerID" headerText="Customer ID" type="string" width="120"></e-grid-column>
<e-grid-column field="Freight" headerText="Freight" textAlign="Right" format="C2" editType="numericedit" width="120"></e-grid-column>
</e-grid-columns>
</ejs-grid>
</div>
<div id="Content2" style="display: none">
<ejs-grid id="ej2grid2" dataSource="@ViewBag.DataSource" allowPaging="true" height="310">
<e-grid-columns>
<e-grid-column field="OrderID" headerText="Order ID" isPrimaryKey="true" textAlign="Right" width="100"></e-grid-column>
<e-grid-column field="CustomerID" headerText="Customer ID" type="string" width="120"></e-grid-column>
<e-grid-column field="Freight" headerText="Freight" textAlign="Right" format="C2" editType="numericedit" width="120"></e-grid-column>
</e-grid-columns>
</ejs-grid>
</div>
</div>
<ejs-tab id="ej2Tab" items="@ViewBag.items"></ejs-tab> |