BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
[Index.cshtml]
<div id="main">
@Html.EJS().Button("primarybtn").Content("Show the Grid in Partial View").IsPrimary(true).Render()
</div>
<div id="GridJ2" />
<script type="text/javascript">
// click event to call ajac post to server
document.getElementById("primarybtn").addEventListener("click", function () {
var ajax = new ej.base.Ajax("/Home/ProductpartialEJ2/", 'POST', true);
ajax.send().then((data) => {
$("#GridJ2").html(data);
});
});
</script>
……………………..
[HomeController.cs]
public ActionResult ProductpartialEJ2()
{
if(order.Count == 0)
BindDataSource();
var model = order;
ViewBag.data = order;
return PartialView("_GridFeaturesJ2", ViewBag);
}
……………………..
[_GridFeaturesJ2.cshtml]
@Html.EJS().Grid("GridJ2").DataSource((IEnumerable<object>)ViewBag.data).Columns(col =>
{
col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Width("75").Add();
col.Field("CustomerID").HeaderText("Customer ID").Width("80").Add();
col.Field("OrderDate").HeaderText("Order Date").Format("yMd").Width("75").Add();
col.Field("EmployeeID").HeaderText("Employee ID").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Width("75").Add();
}).AllowPaging().PageSettings(p => p.PageSize(10)).Render()
@Html.EJS().ScriptManager()
|
Hi Adam,Thanks for your update.We are happy that the problem has been resolved at your end.Regards,Thavasianand S.