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.
Unfortunately, activation email could not send to your email. Please try again.

Id and Parent are Guids. EJ.TreeView crashes

Thread ID:

Created:

Updated:

Platform:

Replies:

133048 Oct 5,2017 04:04 PM Oct 6,2017 08:09 AM ASP.NET MVC 1
loading
Tags: TreeView
Olavi Laitala
Asked On October 5, 2017 04:04 PM

I tried this kind of system:
    public class LoadData
    {
        public Guid Id { get; set; }
        public Guid Parent { get; set; }
        public string Text { get; set; }
        public string SpriteImage { get; set; }
        public string ImageURL { get; set; }
        public bool HasChild { get; set; }
        public bool Expanded { get; set; }
        public bool Selected { get; set; }
        public bool NodeChecked { get; set; }
        public object NodeProperty { get; set; }
        public object LinkProperty { get; set; }
        public object ImageProperty { get; set; }
    };

            VM_TenantUserEdit vm = new VM_TenantUserEdit { TenantId = tenantId };
            vm.datasource = new List<LoadData>();
            Guid g1 = Guid.NewGuid();
            Guid g2 = Guid.NewGuid();
            Guid g3 = Guid.NewGuid();
            Guid g4 = Guid.NewGuid();
            Guid g5 = Guid.NewGuid();
            Guid g6 = Guid.NewGuid();
            Guid parent = Guid.Empty;

            vm.datasource.Add(new LoadData { Id = g1, Parent = parent, Text = "Item 1" });
            vm.datasource.Add(new LoadData { Id = g2, Parent = parent, Text = "Item 2" });
            vm.datasource.Add(new LoadData { Id = g3, Parent = parent, Text = "Item 3" });
            vm.datasource.Add(new LoadData { Id = g4, Parent = g1, Text = "Item 1.1" });
            vm.datasource.Add(new LoadData { Id = g5, Parent = g1, Text = "Item 1.2" });
            vm.datasource.Add(new LoadData { Id = g6, Parent = g3, Text = "Item 3.1" });

 <form>
        <div style="width: 250px">

            @(Html.EJ().TreeView("tree")
            .TreeViewFields(field =>
                field.Datasource(Model.datasource)
                .Id("Id")
                .ParentId("Parent")
                .Text("Text")
                ).ShowCheckbox(true))
        </div>
<form>
It seems that if the keys are Guids, EJ.TreeView crashes. So building the hierarchy with other keys than integer does not work.

In addition, when used inside of a form, tree control should return the id instead of Text. In a localized sw the text can be a random string, but id is always the same.


Ashokkumar Balasubramanian [Syncfusion]
Replied On October 6, 2017 08:09 AM

Hi Olavi, 
 
Thanks for contacting Syncfusion support. 
 
Query 1: It seems that if the keys are Guids, EJ.TreeView crashes. So building the hierarchy with other keys than integer does not work. 
 
We have checked your problem (Unable to building the keys other than integer) in TreeView component, but unfortunately, we are able to reproduce this problem at our end. Please check the below sample. 
 
 
For that sample, we have building the hierarchy with string and used to TreeView component. 
 
Query 2: In addition, when used inside of a form, tree control should return the id instead of Text. In a localized sw the text can be a random string, but id is always the same. 
 
We were unable to understood your exact requirement. Could you please explain your requirement briefly or else please modify the provided sample as like your requirement. This is would be more helpful to provide the proper solution earliest.  
 
Regards, 
Ashokkumar B. 


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.

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.

;