Initial Load Filtering

I just upgraded from version 14 to 16 and I am trying to do initial filtering on the grid.  Before I just loaded a list of Syncfusion.JavaScript.Models.FilteredColumn.  Now I am not seeing anything that does the equivalent to what I was able to do.  Can you show the documentation for this or show me an example of how this would be done?

Thanks!

William

3 Replies

VA Venkatesh Ayothi Raman Syncfusion Team July 9, 2018 12:57 PM UTC

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. 



WM William Miller July 9, 2018 03:35 PM UTC

This worked for me, thank you!  


VA Venkatesh Ayothi Raman Syncfusion Team July 10, 2018 04:04 AM UTC

Hi William, 
 
Thanks for the feedback. 
 
We are very happy to hear that your requirement is achieved. 
 
Regards, 
Venkatesh Ayothiraman. 


Loader.
Up arrow icon