We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Child items not rendering when using templates

Thread ID:

Created:

Updated:

Platform:

Replies:

147920 Sep 27,2019 01:32 PM UTC Sep 30,2019 08:38 AM UTC Blazor 1
loading
Tags: ListView
Fergus
Asked On September 27, 2019 01:32 PM UTC

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

Mohan Ravi [Syncfusion]
Replied On September 30, 2019 08:38 AM UTC

Hi Fergus, 
  
We have checked the reported issue in Listview component with nested templates and we are unable to reproduce the reported issue as it is working as expected . 
  
Please verify that you are on the same version as the NuGet and CDN versions. Below links are referred to our latest version links (v17.3.0.10-beta). 
 
  
<link rel="stylesheet" rel='nofollow' href="https://cdn.syncfusion.com/ej2/17.3.10/material.css"> 
  
And please make sure that you are on Dot Net SDK v3.0.100. 
 
Finally, increase the maximum transfer size of the SignalR connection, if you are using Server Side Blazor Application like below. 
  
[Startup.cs/Startup/ConfigureServices] 
services.AddServerSideBlazor().AddHubOptions(o => 
{ 
       o.MaximumReceiveMessageSize = 102400000; 
}); 
  
I have also attached a sample for your reference with nested template in Listview. Please check it in the below link. 
  
  
If none of this works, please modify or attach a sample with a reproducible issue, so that we can help you better and at earliest. 
  
Regards, 
Mohan 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon