简体   繁体   中英

Nullable bool with ClientTemplate Kendo Grid

I want to display text depending on a nullable bool which is MyBool (Bool?).

My code was: columns.Bound(p => p.MyBool).ClientTemplate("#= MyBool ? 'Yes' : 'No' #") But i have an error:

ClientTemplate does not accept Bool? type

Do I have to convert it to a non-nullable boolean?

如果MyBool.Value不为null,您是否尝试过?

MyBool.HasValue() && MyBool.Value

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM