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. Image for the cookie policy date
close icon

Special TreeView Hierarchy

Dear Syncfusion,
I wonder if the TreeView ASP.NET version 5.2 can handle the special hierarchy shown in the attached file.
The idea is simple (we call it ragged hierarchies) I will try to explain it:

1) The hierarchy consists of four levels. Root node is 'All Stores', first level is country ( Canada and USA ), second level is state (like CA and WA for node USA) and the forth level is store name like Alameda for CA.

2) The node Orizaba and Merida belong to Mexcio which is not shown in the hierarchy but the level of the two nodes is maintained.

I tried to reproduce this with version 5.2 but unfortunately I failed! is such behaviour supportd? possible?

Kind regards from Germany,
Faris Ahmed



SpecialHierarchy.zip

6 Replies

RS Rajarajeswari S Syncfusion Team December 3, 2007 08:20 AM UTC


Hi Faris,

Sorry for the inconvenience caused.

Your requirement of having Child nodes without parent node is not at all possible. In a TreeView you have to get the reference of any child node only by using its Parent node. So your requirement is not possible.

Please let me know if you have any other concerns.

Regards,
Raji




FA Faris Ahmed December 3, 2007 12:32 PM UTC

Dear Syncfusion Support,
I totally agree with you! but I don't want to change the object model of the tree view, the nodes shown in the screen shot still have a parent the only thing is they have some horizontal offset.

Please take a look at the attached SpecialHierarchy2.jpg, it shows a 5.2 TreeView, the xxx and yyy nodes have a left padding property set to 24 pixel, this is half the way for me, now I only need to extend the horizonal padding\offset and make the image to appear next to the xxx node, is this possible?

Best regards,
Faris Ahmed


>
Hi Faris,

Sorry for the inconvenience caused.

Your requirement of having Child nodes without parent node is not at all possible. In a TreeView you have to get the reference of any child node only by using its Parent node. So your requirement is not possible.

Please let me know if you have any other concerns.

Regards,
Raji






SpecialHierarchy2.zip


RS Rajarajeswari S Syncfusion Team December 11, 2007 05:35 AM UTC


Hi Faris,

In TreeView control to move the node along with the image you have to set the padding property to the image. Please refer the below code snippet which illustrates this:

.left_image
{
padding-left: 24px;
}

The above class has to be applied to all the states of the TreeViewItemLook. Please refer the below code snippet which illustrates this:

TreeViewItemLook look1 = new TreeViewItemLook();
look1.ID = "look";
look1.StateDataDefault.LeftImageCSSClass = "left_image";
look1.StateDataExpanded.LeftImageCSSClass = "left_image";
look1.StateDataHover.LeftImageCSSClass = "left_image";
look1.StateDataActive.LeftImageCSSClass = "left_image";
//add the look to the treeview.
tv.ItemLooks.Add(look1);

Please refer the sample from the below link which illustrates the above:

http://websamples.syncfusion.com/samples/Tools.Web/5.2.0.25/F70085/main.htm

Please let me know if this helps you out.

Regards,
Raji




FA Faris Ahmed December 12, 2007 05:46 PM UTC

Hi Raji,
Thanks for you support. With your latest suggestion I closer to my goal, nevertheless the hierarchy lines don't reflect the real hierarchy now, please see my attached picture.
Can the hierarchy lines be changed programatically?
Another question can I store extended properties ( like level ) in the TreeNode object? I am missing the Tag property available in all windows control objects.

Thanks,
Faris



Syncfusion.zip


RS Rajarajeswari S Syncfusion Team December 14, 2007 03:35 AM UTC

Hi Faris,

1. Can the hierarchy lines be changed programmatically?

Sorry, It is not possible to change the hierarchy line programmatically.

2. Can I store the extended properties in TreeNode Object?

Sorry again currently we do not provide support to store any extended properties in Node objects. But for every TreeNode there is property called "Value". You can store some text in this and retrieve it using the NodeSelected event.

Please have look at the below link to get more details on this:

http://www2.syncfusion.com/ug_61/toolsweb/default.html

Please let me know if you have any other concerns.

Regards,
Raji




RI Rafi Irvan April 8, 2018 12:08 PM UTC

This is good

Loader.
Live Chat Icon For mobile
Up arrow icon