Display Text Instead Of Boolean In Grid Column

2 Answers 128 Views
Grid
Graham
Top achievements
Rank 2
Iron
Iron
Graham asked on 08 Dec 2021, 04:06 PM
I have a Boolean grid column. If the value is true, I want to display 'Deleted', and if the value is false, I want to display 'Active'. What's the easiest way to do this, please?

2 Answers, 1 is accepted

Sort by
1
Accepted
Dimiter Topalov
Telerik team
answered on 09 Dec 2021, 09:34 AM

Hello Graham,

The most straight-forward approach to display custom content based on a data item value, is to utilize the Grid cell template:

https://www.telerik.com/kendo-angular-ui-develop/components/grid/columns/templates/#toc-cell-template

The following example demonstrates how to achieve the desired effect in a boolean column:

https://stackblitz.com/edit/angular-rzl8ta?file=app/app.component.ts

If filtering is applied, the default filter labels (Is True/Is False) can also be customized through the Grid custom messages:

https://www.telerik.com/kendo-angular-ui-develop/components/grid/globalization/#toc-custom-messages

Here is another example showcasing this approach:

https://stackblitz.com/edit/angular-zyzevz?file=app/app.component.ts

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Graham
Top achievements
Rank 2
Iron
Iron
answered on 09 Dec 2021, 10:18 AM
Perfect! Thanks.
Tags
Grid
Asked by
Graham
Top achievements
Rank 2
Iron
Iron
Answers by
Dimiter Topalov
Telerik team
Graham
Top achievements
Rank 2
Iron
Iron
Share this question
or