Dropdownlist item removing spaces/ tabs from the text value

1 Answer 232 Views
DropDownList
Beena
Top achievements
Rank 1
Iron
Iron
Beena asked on 12 Apr 2022, 02:13 PM

Telerik Team,

Currently, I am concatenating the text field value of dropdown list  to include spaces or tabs in order to show data indented as tree view. Seems like the Telerik dropdown list component is removing space or tabs. I have also tried using   (HTML tag) to accomplish this task. But this does not seem to work as well (may be due to HTML encoding/decoding). Is there are a way I can show the list items as intended data.

Thank you for your help.

Beena.

Timothy J
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 12 Apr 2022, 07:15 PM

Use a treeview?

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 14 Apr 2022, 11:05 AM

 Hi Beena,

  will work, but you need ItemTemplate. Also, the   must be outside the actual model values.

Since you will be using a template, you can implement the formatting (indentation) in any other way via custom HTML/CSS.

Regards,
Dimo
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Beena
Top achievements
Rank 1
Iron
Iron
commented on 14 Apr 2022, 01:37 PM

Hello Dimo,

Yes, ItemTemplate worked for me. Added space to the textfield of the item and used HTML <pre> element to maintain formatting of text.

 

 

 

Tags
DropDownList
Asked by
Beena
Top achievements
Rank 1
Iron
Iron
Answers by
Dimo
Telerik team
Share this question
or