Hi Imran,
Thank you for using Syncfusion products.
We have checked your requirement and it can be achievable in Spreadsheet. Using ‘allowVirtualScrolling’ property, you can enable the virtual scrolling feature in Spreadsheet (It’s default value is true). And, your requirement ‘load data on demand’ can be achieved by binding the datasource using ej.DataManager in Spreadsheet. Please refer the below code example.
HTML
|
<div id="Spreadsheet"></div>
//...
<script type="text/javascript">
$(function () {
var dataManager = ej.DataManager({
url: "Home/GetDatasource",
adaptor: new ej.UrlAdaptor(),
crossDomain: true
});
$("#Spreadsheet").ejSpreadsheet({
sheets: [
{
dataSource: dataManager,
query: ej.Query().take(200),
primaryKey: "OrderID"
}],
columnWidth: 100,
scrollSettings: {
height: 550,
//allowVirtualScrolling: true //Default value - true
}
});
});
</script>
|
C#
|
public ActionResult GetDatasource(DataManager dm)
{
IEnumerable<Order> Data = new NorthwndDBContextDataContext().Orders.ToList();
int count = Data.AsQueryable().Count();
Syncfusion.JavaScript.DataSources.DataOperations operation = new Syncfusion.JavaScript.DataSources.DataOperations();
Data = (IEnumerable<Order>)operation.Execute(Data, dm);
return Json(new { result = Data, count = count }, JsonRequestBehavior.AllowGet);
}
|
Could you please check the above sample and get back to us with more information if your requirement is not fulfilled or need further assistance on this?
Regards,
Silambarasan