2
votes

I'd like to show different values in a Kendo Grid cell. Something similar to: "#=IValue ? '1':'0'#".

What's the correct syntax to use a switch to achieve this?

2

2 Answers

2
votes

You can use an if/else statement. See this page.

# if (IFlowCode == 1) {# 'A' #} else if (IFlowCode == -1) {# 'b' #} else if (IFlowCode == 0) {# 'C' #}#");
2
votes

I was finally able to get the switch working in the ClientTemplate :)

columns.Bound(c => c.HaveNAS).ClientTemplate(@"#var NASVal; switch(HaveNAS){ case 1: NASVal = 'Yes'; break; case 2: NASVal = 'No'; break; case 3: NASVal = 'Probably'; break; default: NASVal = 'Not Sure'; }##=NASVal#")