@
using Telerik.Web.Mvc.UI;
@model
IEnumerable<TPRO.Models.GroupsModels>
@model
IEnumerable<TPRO.Models.SubGroupsModels>
@{
View.Title =
"Home Page";
}
<
table width="100%" cellpadding="0" border="0" cellspacing="0">
<tr valign="top" align="left"><td style="background:#FFF8C6">
@(
Html.Telerik().TreeView()
.Name(
"TreeView")
.Effects(fx =>
{
if (ViewData["animation"].ToString() == "slide")
{
fx.Slide();
}
else if (ViewData["animation"].ToString() == "expand")
{
fx.Expand();
}
else
{
/* activate only toggle, so that the items show */
fx.Toggle();
}
if ((bool)ViewData["enableOpacityAnimation"])
fx.Opacity();
fx.OpenDuration((
int)ViewData["openDuration"])
.CloseDuration((
int)ViewData["closeDuration"]);
})
.BindTo(Model, mappings =>
{
mappings.For<GroupsModels>(binding => binding
.ItemDataBound((item, groupModel) =>
{
item.Text = groupModel.Group;
})
.Children(groupModel => groupModel.rID));
mappings.For<SubGroupsModels>(binding => binding
.ItemDataBound((item, SubGroupModel) =>
{
item.Text = SubGroupModel.SubGroup;
}));
})
)
</td><td align="right" style="width:300px"><img alt="" src="../../images/logo.jpg" /></td></tr>
<tr style="background:#000000"><td align="center" colspan="2"><h2 style="color:White">Welcome to GDOT Transportation Projects</h2></td></tr>
</
table>
it is telling me that both models are not recognizable and if i do make the changes
Only one 'model' statement is allowed in a file.
do you have an example please with razor page with a treeview that loads parent and a child? thanks