Tertiary conditional used in template?

Can a C# tertiary conditional statement be used in a template? I tried, but get errors in the component design display...but it works at runtime. Something like this:

<Template Context="data">
@((data.sensorType >= 0) && (data.sensorType < sensorTypes.Count) ? sensorTypes[data.sensorType].desc : "")                  

If I change this to use "if else" it works at both designtime and runtime.

Not sure in which component template is this, can you clarify? I've tried DataGrid column template the following and it worked:

The application I tested in Blazor server, .NET6.

Your post is in Blazor Components category however most probably should be in Radzen Blazor server/WebAssembly

Well, I tried it again and it works? I guess I had a bit of syntax off maybe?