Displaying the HTML content
21 Dec 20221 minute to read
The HTML tags can be displayed in the TreeGrid header and content by enabling the disableHtmlEncode property.
<ejs-treegrid id="TreeGrid" dataSource="@ViewBag.datasource" height="300" childMapping="Children" treeColumnIndex="1">
<e-treegrid-columns>
<e-treegrid-column field="TaskId" headerText="<span> Task ID </span>" disableHtmlEncode="true" textAlign="Right" width="100"></e-treegrid-column>
<e-treegrid-column field="TaskName" headerText="<span> Task Name </span>" disableHtmlEncode="true" width="190"></e-treegrid-column>
<e-treegrid-column field="StartDate" headerText="Start Date" textAlign="Right" format="yMd" type="date" width="120"></e-treegrid-column>
<e-treegrid-column field="Duration" headerText="Duration" textAlign="Right" width="110"></e-treegrid-column>
</e-treegrid-columns>
</ejs-treegrid>public IActionResult Index()
{
var tree = TreeData.GetDefaultData();
ViewBag.datasource = tree;
return View();
}NOTE
You can refer to our
ASP.NET Core Tree Gridfeature tour page for its groundbreaking feature representations. You can also explore our ASP.NET Core Tree Grid exampleASP.NET Core Tree Grid exampleto knows how to present and manipulate data.