I need to render this Telerik treeview control in a telerik menu item with
menu display name: Locations. Can you tell me how I can place a Telerik Tree view
control (exact code below) into at telerik menu item with menu name : 'Locations'
I have added my code below for your reference. This code does not render the Treeview control. I have tried setting OpenOnClick true and false but still does not work.
<li>
<% Html.Telerik().Menu()
.OpenOnClick(true)
.Name("locations")
.Items(items =>
{
items.Add()
.Text("Locations")
.Content(() =>
{
%>
<% Html.Telerik().TreeView()
.Name("TreeView1")
.ShowCheckBox(true)
.BindTo(Model.SessionProvider.GetAvailableLocations, mappings =>
{
mappings.For<RegionEntity>(binding => binding
.ItemDataBound((item, region) =>
{
item.Text = region.RecordName;
item.Value = region.ID.ToString();
//if (checkedNodes != null)
//{
// var checkedNode = checkedNodes.Where(e => e.Value.Equals(employee.EmployeeID.ToString())).FirstOrDefault();
// item.Checked = checkedNode != null ? checkedNode.Checked : false;
//} item.Expanded = true;
}).Children(location => location.Location));
mappings.For<LocationEntity>(binding => binding
.ItemDataBound((item, location) =>
{
item.Text = location.Name;
item.Value =
location.Number.ToString();
}));
}).Render();%>
<%
});
})
.Render();
%>
</li>