hidden
hidden

Reputation: 3236

Kendo Grid Filter grid based on a value from a collection

Simple yet dificult for me. I just want to apply a filter to the grid if based on the FileCategory filter category name. Suppose I wanted to filter the grid for items that had a category name of Central Supply. Here is the data, and my attempt. In my attempt I show that the filter works for a property(single value) but I cant make it work for a collection.

Data: [
    -{
    Id: 1
    FileName: "MyFile"
    RevisionDate: "2013-01-08T00:00:00"
    FormNumber: "MyFormName"
    FormTitle: "aa"
    Class: "a"
    SecondaryCategory: "a"
    UploadDate: "2013-01-11T08:34:46.677"
    -FileCategoryFilter: [
    -{
    FileCategoryId: 1
    CategoryName: "Administrative Manual Docs"
    Active: true
    File: null
    }
    -{
    FileCategoryId: 4
    CategoryName: "Central Supply"
    Active: true
    File: null
    }
    ]
    }

Kendo Grid Server Wrapper

 .Filter(filters =>
 // { filters.Add(p => p.FileName).IsEqualTo("Central Supply");})
//this filter works for a property but I havent figured out how to do a collection. 
    { 
       filters.Add(
             p =>p.FileCategoryFilter.Select(i=>i.CategoryName).Contains("Central Supply")
    );
 })

Upvotes: 1

Views: 858

Answers (1)

Petur Subev
Petur Subev

Reputation: 20193

I am afraid this is not supported - only single value could be used for an operator. The wrappers uses the following client side equivalent - check this part of the documentation. You can try to specify several filters on the same field with OR logic.

Upvotes: 2

Related Questions