This question is locked. New answers and comments are not allowed.
Hi,
I am using Telerik MVC Grid. One on the column in my grid shows comma separated list of states like below
ACT, NSW, QLD,VIC
I want to show each state in separate line like below
ACT
NSW
QLD
VIC
But I can't seem to achieve this trivial task.
My code looks like below.
columns.Template(e => FormatStates(e)).Title("States");
And the helper looks like below.
@helper FormatStates(MyModel item)
{
@(item.States.Replace(",", "\n"))
}
I have also tried <br> and \r\n instead of \n but in vain.
Can somebody please show me how to add new line character.
Thanks in advance
Manish
I am using Telerik MVC Grid. One on the column in my grid shows comma separated list of states like below
ACT, NSW, QLD,VIC
I want to show each state in separate line like below
ACT
NSW
QLD
VIC
But I can't seem to achieve this trivial task.
My code looks like below.
columns.Template(e => FormatStates(e)).Title("States");
And the helper looks like below.
@helper FormatStates(MyModel item)
{
@(item.States.Replace(",", "\n"))
}
I have also tried <br> and \r\n instead of \n but in vain.
Can somebody please show me how to add new line character.
Thanks in advance
Manish