I am attempting to use variables in classes and column widths in a MudItem.
The source is a database record. The objective is to make the page dynamic, sourced from the database. The following line requires the “mColumns” to be an integer, but is originally a string. Is there a way I can convert mColumns to a string in this mark-up?
<MudItem id="@MyQuestion.Key" xs="12" sm="@mColumns" class="@MyQuestion.ControlCss" style="@MyQuestion.Style"> <label>@MyQuestion.Value</label> </MudItem>
I tried converting mColumns to an integer and it worked, but I am ultimately hoping to use the source string.
I also tried using “MudElement” instead which allowed the use of the string. Is there an advantage to using “MudItem” over “MudElement”?