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

Grouping by bool datatype

1 Answer 105 Views
Data Query
This is a migrated thread and some comments may be shown as answers.
Flemming
Top achievements
Rank 2
Flemming asked on 22 May 2019, 02:40 PM

Hi,

 

Can I use groupBy for a column of boolean datatype?

like this:

const datasource = groupBy(s.value, [{field: 'MyBoolProperty'}]);

 

I am trying to pass this to a Dropdownlist and it works if the column is a string typed column.

 

Best regards

Flemming Christiansen

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 24 May 2019, 10:37 AM
Hi Flemming,

The DataQuery itself supports grouping by boolean field, but the DropDownList expects string value in the grouped by field. You will encounter the same problem if you try to group by a number field.

A simple workaround is to map the data and manually convert the boolean/number into string. Here's a quick demo that demonstrates the approach in action:

I hope this will help.

Regards,
Alexander Valchev
Progress Telerik
Get quickly onboarded and successful with your Telerik and Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Data Query
Asked by
Flemming
Top achievements
Rank 2
Answers by
Alexander Valchev
Telerik team
Share this question
or