Hi,
I am having an issue with the listview where child items are blank after i click on a parent item.
If i remove the <Template> tag then everything works ok. All child nodes are visible. But when <Template> tag is added even with simple markup like...
<ListViewTemplates>
<Template>
@{
ListItem currentData = context as ListItem;
<div>@currentData.Text</div>...
}
</Template>
The parent nodes load fine but the child nodes are not there.
I am using code like the following to load the nodes...
ListData = (from to in topics
select new ListItem()
{
Id = "to" + to.TopicId,
Text = to.TopicName,
Icon = "folder",
Depth = 0,
Child = (from th in to.Threads
where to.Enabled == true
select new ListItem()
{
Id = "th" + th.ThreadId,
Text = th.ThreadName,
Icon = "file",
Depth = 1,
Child = (from me in th.Messages
select new ListItem()
{
Id = "me" + me.MessageId,
Text = me.MessageHeading,
Icon = "file",
Depth = 1
}).ToList<ListItem>()
}).ToList<ListItem>()
}).ToList<ListItem>();
In the debugger i can see all the child nodes and as mentioned when <Template> is removed it works find but when it is added it fails to load the child nodes.
Any ideas what may be causing this?
Thanks