Kendo Q3 2015, asp.net mvc
I have the scenario where I'm binding columns to nullable objects. I'm using the client template, and have a little html to add if the value is not null.
I've simplied my code here. "ChildObject" is a property that can be null. If it is null, show nothing. If it is not null, show ChildObject.Name (in some custom html)
columns.Bound(c => c.ChildObject.Name)
.Title(
"Some Column"
)
.ClientTemplate(
"#= (ChildObject == null) ? ' ' : '<div>' + ChildObject.Name + '</div>' #"
)
.Width(100);
This code throws the invalid template error. If I remove the '+'s, it works fine. Example: '<div>Hello</div>' works, however that wouldn't allow me to add databound text.
Thanks