Hi,
I've just started using Telerik UI for .NET Core.
I'm just trying to build a simple tree and add images to each node. For some reason it's not displaying the images.
Any help would be greatly appreciated.
I'm hardcoding the names of the nodes and the images, so all the action is in the .cshtml file.
Here's my code. If you just look at the first node I'm trying to add(Inbox), you'll see all of the ways I tried to add an image to the node.
I have all but one way commented out. The rest of the code is just trying to the same things for additional nodes.
@page
@model Bakery.Pages.ConversionManagerModel
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>ConversionManager</title>
<link rel="stylesheet" href="~/lib/kendo-ui/styles/kendo.common-nova.min.css" />
<link rel="stylesheet" href="~/lib/kendo-ui/styles/kendo.nova.min.css" />
<script src="~/lib/jquery/dist/jquery.js"></script>
@* Place Kendo UI scripts after jQuery *@
<script src="~/lib/kendo-ui/js/kendo.all.min.js"></script>
<script src="~/lib/kendo-ui/js/kendo.aspnetmvc.min.js"></script
</head>
<body>
<div>
@(Html.Kendo().TreeView()
.Name("treeview-images")
.Items(treeview =>
{
treeview.Add().Text("Inbox")
//.ImageUrl(Url.Content("~/Shared/Images/db78.png"))
//.ImageUrl(Url.Content("./Shared/Images/db78.png"))
//.ImageUrl(Url.Content("C:/tmp/db78.png"))
//.ImageUrl(Url.Content("C:/tmp/db78.png"))
.ImageUrl("~/Shared/Images/db78.png")
.Expanded(true)
.Items(inbox =>
{
inbox.Add().Text("Read Mail")
.ImageUrl(@"c:\tmp\db78.png");
});
treeview.Add().Text("Drafts")
.ImageUrl(Url.Content(@"c:\tmp\db78.png"));
treeview.Add().Text("Search Folders")
.ImageUrl(Url.Content(@"c:\tmp\db78.png"))
.Expanded(true)
.Items(inbox =>
{
inbox.Add().Text("Categorized Mail")
//.ImageUrl(Url.Content(@"c:\tmp\db78.png"));
.ImageUrl(Url.Content(@"C:\tmp\db78.png"));
inbox.Add().Text("Large Mail")
.ImageUrl(Url.Content(@"c:\tmp\db78.png"));
inbox.Add().Text("Unread Mail")
.ImageUrl(Url.Content(@"c:\tmp\db78.png"));
});
treeview.Add().Text("Settings")
.ImageUrl(Url.Content(@"c:\tmp\db78.png"));
})
)
</div>
</body>
</html>
Thanks.