Setup initial column filtering

Sometime you need to setup initial column filtering after page loads first time. After that user can work this pre-filtered grid or clear/change filter settings.

You can do this, using SetInitialFilter method:

columns.Add(o => o.Customer.CompanyName)
        .Titled("Company Name")
        .ThenSortByDescending(o => o.OrderID)
        .SetInitialFilter(GridFilterType.StartsWith, "a")

After that you need to tell Grid.Mvc to apply initial settings by passing grid-init parameter to query string:

http://<url>/?grid-init=1

Last edited Feb 14, 2013 at 2:59 AM by Bukharin, version 2