TreeView
TreeView
Images
This view shows how to add images to the nodes in a TreeView control.
Features
Sample
Description
Use the "image-member-path" attribute to add images to nodes by specifying the name of a property on the data items that contains an image URL.
In this sample, the source contains the Image field, which value is an image url. "Image" is set to the "image-member-path" attribute.
Source
ImagesController.cs
using MvcExplorer.Models; using Microsoft.AspNetCore.Mvc; namespace MvcExplorer.Controllers { partial class TreeViewController { // GET: Images public ActionResult Images() { return View(Property.GetData(Url)); } } }
Images.cshtml
@model Property[] <c1-tree-view display-member-path="Header" child-items-path="Items" image-member-path="Image" source="Model"></c1-tree-view> @section Summary{ <p>@Html.Raw(TreeViewRes.Images_Text0)</p> } @section Description{ <p>@Html.Raw(TreeViewRes.Images_Text1)</p> <p>@Html.Raw(TreeViewRes.Images_Text2)</p> }
Documentation