Hi Wiiliam,
Thanks for using Syncfusion products.
As from your query we suspect that would you like to perform initial filtering in server side while using Essential ASP.NET MVC 2 Grid. If so, we have achieved your requirement using Model binding in Grid like as follows,
|
public ActionResult Index()
{
var order = OrdersDetails.GetAllRecords();
Syncfusion.EJ2.Grids.Grid gridProp = new Syncfusion.EJ2.Grids.Grid();
gridProp.AllowFiltering = true;
List<object> col = new List<object>();
col.Add(new { field = "ShipCountry", matchCase = false, @operator = "startswith", predicate = "and", value = "Brazil" });
gridProp.FilterSettings = new Syncfusion.EJ2.Grids.GridFilterSettings() { Columns=col}; //initial filter on server side
ViewBag.datasource = order;
return View(gridProp);
}
[View]
@model Syncfusion.EJ2.Grids.Grid
@Html.EJS().Grid("FlatGrid", Model).DataSource((IEnumerable<Object>
)ViewBag.datasource).Columns(col =>
{
. . .
}).AllowPaging().Render() |
We have also prepared a sample based on your requirement which can be download from following link,
Please let us know if you have any further assistance on this.
Regards,
Venkatesh Ayothiraman.