BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hi James,
Thanks for using Syncfusion products,
Based on your Request ,
We have created a sample for paging action in Ej MVC Grid (12.2.36 version) . Please follow the below code snippet.
[controller] public ActionResult DataSource([Bind(Prefix = "$skip")]int? skip, [Bind(Prefix = "$top")]int? top)
{
var DataSource = OrderRespositary.GetAllRecords();
var result = DataSource.Skip((int)skip).Take(10).ToList();
var count = DataSource.Count();
return Json(new { d =
new { results = result, __count = count }
}, JsonRequestBehavior.AllowGet);
}
[View
Model] @model string
@(Html.EJ().Grid<servesidePaging.OrdersView>("FlatGrid")
.Datasource(ds => ds.URL("Home/DataSource")) .AllowPaging()
/*Paging Enabled*/ ) |
Sample:
servesidePaging.zip
Please let us know if have any queries,
Regards,
J.Mohammed Farook
Hi James,
Thanks for your update.
Please get back if you require
further assistance. We will be glad to assist you.
Regards,
J.Mohammed
Farook
public ActionResult Data(DataManager dm) { var DataSource1 = OrderRepository.GetAllRecords(); DataResult res = new DataResult(); res.result = DataSource1.Skip(dm.Skip).Take(dm.Take).ToList(); res.count = DataSource1.Count(); return Json(res, JsonRequestBehavior.AllowGet); |
@(Html.EJ().Grid<OrdersView>("Editing") .Datasource((IEnumerable<object>)ViewBag.dataSource) .EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.Dialog); }) .Columns(col => { col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).ValidationRules(v => v.AddRule("required", true).AddRule("number", true)).Width(90).Add(); col.Field("CustomerID").HeaderText("Customer ID").Width(90).ValidationRules(v => v.AddRule("required", true).AddRule("minlength", 3)).Add(); col.Field("Freight").HeaderText("Freight").TextAlign(TextAlign.Right).Width(75).EditType(EditingType.Numeric).Format("{0:C}").Add(); col.Field("ShipCountry").HeaderText("Ship Country").EditType(EditingType.Dropdown).Width(85).Add(); col.Field("ShipCity").HeaderText("Ship City").Width(90).Add(); }) |