'Kendo Grid filter with boolean field customization
I have boolean field (returns: true/false), where I had to show 'Yes'/'No' respectively. I did it by:
col.Bound(con => con.IsPreConfigured).Title("Preconfigured Lineup").Width(90).ClientTemplate("#=IsPreConfigured? 'Yes' : 'No' #");
Now I need a filter option with 'Yes'/'No' drop-down. I tried like below:
col.Bound(con => con.IsPreConfigured)
.Title("Preconfigured Lineup")
.Width(90)
.ClientTemplate("#=IsPreConfigured? 'Yes' : 'No' #")
.Filterable(ftb => ftb
.Multi(true)
.CheckAll(false)
.BindTo(new[]
{
new { IsPreConfigured = "True" },
new { IsPreConfigured = "False" }
}));
It's working well, but I need the drop-down item to show 'Yes' and 'No' instead of 'True' and 'False'.
Any suggestions? Thanks in advance.
Solution 1:[1]
Try this:
.Filterable(filter => filter
.Messages(message => message
.IsFalse("No")
.IsTrue("Yes")
)
)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | CarenRose |

