How to disable encoding on the text property.

The data that is to be displayed in the TreeView can contains angle brackets is there a way to disable encoding?


1 Reply 1 reply marked as answer

SS Sharon Sanchez Selvaraj Syncfusion Team February 23, 2021 10:02 AM UTC

Hi MCR, 

Thanks for contacting Syncfusion Support. 

We have checked with your requirement. 

This can be achieved by setting EnableHtmlSanitizer as true. Please check with the below code for your reference. 

@Html.EJS().TreeView("listdata").EnableHtmlSanitizer(true).Fields(field => 
    field.Id("id").ParentID("pid").Selected("selected"). 
    Expanded("expanded").Text("name").HasChildren("hasChild") 
    .DataSource(ViewBag.dataSource)).Render() 

Please check with the sample attached over here for your reference. 


Please check with the below links to know more about TreeView component. 




Please get back to us if you need any further assistance. 

Regards, 

Sharon Sanchez S. 


Marked as answer
Loader.
Up arrow icon