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

Filtering/sorting on bit flag column

3 Answers 273 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nicholas
Top achievements
Rank 1
Nicholas asked on 13 Mar 2014, 09:29 PM
Hi,

I'm trying to find out whether Kendo supports filtering and sorting operations (client side) on bit flag columns (i.e enums with the [Flags] attribute).

We'd like to have one column that displays several different icons depending on which bits are set in the column. This can be accomplished easily with a client template, but filtering looks more complex. By default, it looks like Kendo will try and set "equal to" as the operator in the generated filter expression, when we really need a logical and to return records with the selected flag bits set. I've dug through the source code a bit and it doesn't seem that filter expressions can support logical and or logical or as the operator for a single filter (I am not talking about the logic used to combine multiple filters). Is this correct, or is there something I've overlooked?

Thanks,
Nick

3 Answers, 1 is accepted

Sort by
0
Nicholas
Top achievements
Rank 1
answered on 14 Mar 2014, 09:44 PM
Noticed a mistake in my post but I don't see any means to edit it:

I am referring to bitwise and/or operations in Kendo filter expressions, not logical as I said before.
0
Accepted
Alexander Popov
Telerik team
answered on 17 Mar 2014, 02:56 PM
Hi Nick,

You are correct - this scenario is currently not supported.

Regards,
Alexander Popov
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
1
Nicholas
Top achievements
Rank 1
answered on 18 Mar 2014, 06:18 PM
Ok, thanks. What I did instead was write some code to map the individual bits to boolean properties on the data item, and a custom click handler for the filter button that would handle this properly. It's a bit messy, but it worked.
Tags
Grid
Asked by
Nicholas
Top achievements
Rank 1
Answers by
Nicholas
Top achievements
Rank 1
Alexander Popov
Telerik team
Share this question
or