This is a migrated thread and some comments may be shown as answers.

Set active filter programatically

1 Answer 48 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 03 Dec 2016, 01:25 AM

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.

???

 

1 Answer, 1 is accepted

Sort by
0
Dan
Top achievements
Rank 1
answered on 05 Dec 2016, 05:50 PM

Seems like the correct syntax for 'equals' is:

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

 

Thanks

Tags
Grid
Asked by
Dan
Top achievements
Rank 1
Answers by
Dan
Top achievements
Rank 1
Share this question
or