We have analyzed your query and we suggest you to use virtualScrolling feature by enabling the property as allowVirtualScrolling and setting virtualScrollMode as continuous which is the property of scroll settings in grid.
Please refer the below code example
$(function () { var element = $("#Grid"); element.ejGrid({ dataSource: window.virtualData, allowScrolling: true, scrollSettings: { width: "auto", height: 300, allowVirtualScrolling: true, virtualScrollMode: ej.Grid.VirtualScrollMode.Continuous }, columns: [ … ] }); }); |
[Index.cshtml] <div id="Grid"></div> <script type="text/javascript"> $(function () { $("#Grid").ejGrid({ dataSource: ej.DataManager({ url: "/Home/DataSource", adaptor: new ej.UrlAdaptor(), }), allowScrolling: true, scrollSettings: { width: "auto", height: 300, allowVirtualScrolling: true, virtualScrollMode: ej.Grid.VirtualScrollMode.Continuous }, columns: [ ..... ] }); }); </script> [Controller.cs] public ActionResult DataSource(DataManager dm) { var DataSource = OrderRepository.GetAllRecords(); DataResult result = new DataResult(); result.count = DataSource.Count(); result.result = DataSource.Skip(0).Take(12); return Json(new { result = result.result, count = result.count }, JsonRequestBehavior.AllowGet); } |