ASP.NET MVC Controls | ComponentOne
Working with Controls / FlexGrid / Work with FlexGrid / Exclusive Value Search
In This Topic
    Exclusive Value Search
    In This Topic

    FlexGrid offers an exclusive value search feature which enables Excel-like behavior wherein searching excludes items from the filter. It provides ExclusiveValueSearch property in ValueFilter class, which sets a value that determines whether the filter should only include values selected by the FilterText property. This property is of type Boolean and is set to true, by default, allowing the search to exclude items from the filter. If set to false, searching only affects which items are displayed on the list and not which items are included in the filter.

    To include exclusive value search in FlexGrid, use the following code. In this example, we have created a model with Person type data that includes ID, Name, Country, First, Last and Sales properties.


    Copy Code
    public static List<Person> Persons = SampleData.GetData().ToList();
            public ActionResult Index()
                return View(Persons);


    Copy Code
          .Filterable(f => f.DefaultFilterType(FilterType.Both)
               .ColumnFilters(cfsb =>
                      cfsb.Add(cfb => cfb.Column("First").FilterType(FilterType.Value).ValueFilter(vfb =>
        .Bind(m => m.Bind(Model)