Set active filter programatically

2 posts, 0 answers
  1. Dan
    Dan avatar
    37 posts
    Member since:
    Oct 2013

    Posted 02 Dec 2016 Link to this post

    Trying to apply (default filter) active.
    where plu.pluActive is a boolean

    I have tried:

    .Filter(filters => { filters.Add(plu => plu.pluActive == true); })
     
    .Filter(filters => { filters.Add(plu => plu.pluActive).Equals(true); })
     
    .Filter(filters => { filters.Add(plu => plu.pluActive).Equals("true"); })

    They all filter out all the rows.
    If I comment out:

    //.Filter(filters => { filters.Add(plu => plu.pluActive == true); })

     

    I get all the rows.

    ???

     

  2. Dan
    Dan avatar
    37 posts
    Member since:
    Oct 2013

    Posted 05 Dec 2016 Link to this post

    Seems like the correct syntax for 'equals' is:

    .Filter(filters => { filters.Add(plu => plu.pluActive).IsEqualTo(true); })

     

    Thanks

Back to Top