Filtering by List<string>

4 posts, 0 answers
  1. Taylor
    Taylor avatar
    4 posts
    Member since:
    Sep 2012

    Posted 21 Oct 2013 Link to this post

    Hello, I have a kendo grid with a column that displays as List<string> using a client template:

    columns.Bound(u => u.CostCentreNames)
         .ClientTemplate("#= costCentreList(data) #")
         .Filterable(true)
         .Sortable(false);
    function costCentreList(item) {
    var html = "";
    for (var i = 0; i < item.CostCentreNames.length; i++) {
    if (item.CostCentreNames[i] != 'undefined') {
    html += "<div>";
    html += item.CostCentreNames[i];
    html += "</div>";
    }
    }
    return html;
    }

    CostCentreNames is a List<string>.

    Is it possible to filter based on the values of those strings?  i.e. show only rows where that column contains the value '100'. could you provide an example if so.  Thx!
  2. Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 23 Oct 2013 Link to this post

    Hello Taylor,

    The built-in filtering does not support filtering a collection field. It is possible to implement it by passing the value to the server and filtering the data before using the ToDataSourceResult method. I attached a sample project that uses a multiselect to filter the columns that contain any of the selected values.

    Regards,
    Daniel
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Georgi
    Georgi avatar
    1 posts
    Member since:
    Feb 2015

    Posted 30 May in reply to Daniel Link to this post

    Hello Daniel,

    I know this is an old post, but instead of opening a new thread it's better to ask it here.

    Is this feature have been implemented? Since the original request there were a lot of releases of Kendo Grid and probably you have considered this as a good feature.

     

    Thanks,

    Georgi

  5. Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 01 Jun Link to this post

    Hello Georgi,

    I am afraid that this is still not supported and is not currently planned. I can suggest to open a feature request in our feedback portal.

    Regards,
    Daniel
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready