'Enabled' property in underlying data screws up Treeview

Using SF 19.3.46

If you try this example : https://blazor.syncfusion.com/documentation/treeview/data-binding


But you make this change (Add 'Enabled' property)

 public class MailItem
    {
        public string Id { get; set; }
        public string FolderName { get; set; }
        public bool Expanded { get; set; }
public bool Enabled {get;set} public List<MailItem> SubFolders { get; set; } }


The following exception occurs: 

2021-11-02 10:20:08.612 +13:00 [WRN] Unhandled exception rendering component: Unable to cast object of type 'System.Boolean' to type 'System.String'.

System.InvalidCastException: Unable to cast object of type 'System.Boolean' to type 'System.String'.

   at Syncfusion.Blazor.Navigations.Internal.CreateListFromComplex`1.GetMappedData(TValue fieldData)

   at Syncfusion.Blazor.Navigations.Internal.CreateListFromComplex`1.BuildRenderTree(RenderTreeBuilder __builder)

   at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b__6_0(RenderTreeBuilder builder)

   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)

   at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)

   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()




2 Replies

IL Indhumathy Loganathan Syncfusion Team November 2, 2021 01:15 PM UTC

Hi Joseph, 
 
Greetings from Syncfusion support. 
 
We have validated your reported query in TreeView component. We can replicate the issue at our end and considered this as a bug. The fix for this issue will included in our Volume 3 SP release which is expected to be rolled out by the mid of November 2021. You can track the status through the below link. 
 
 
We appreciate your patience. 
 
Regards, 
Indhumathy L 



KR Keerthana Rajendran Syncfusion Team November 25, 2021 12:36 PM UTC

Hi Joseph, 
 
 
Sorry for the delay. 
 
 
We are glad to announce that Essential Studio 2021 Volume 3 Service Pack Release v19.3.0.53 is rolled out and is available for download under the following link. 
 
 
 
 
In this release, we have included a fix for the issue “TreeView throws an exception when using the Enabled attribute in TValue”. To access this fix, we suggest you to update the package to the SP version (v19.3.0.53). 
 
 
 
 
 
 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.  
 
Regards, 
Keerthana R. 


Loader.
Up arrow icon