- Home
- Forum
- ASP.NET MVC - EJ 2
- Initial Load Filtering
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
SIGN IN To post a reply.
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,
Sample: http://www.syncfusion.com/downloads/support/directtrac/general/ze/F138585_Initialfilter1415980228
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.
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
WM William Miller
- Jul 6, 2018 07:35 PM UTC
- Jul 10, 2018 04:04 AM UTC