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

How do I set the icon image for an individual TreeNodeAdv

Ok, I admit it, I''m confused. I want to be able to individually set the icons for different TreeNodeAdvs in my TreeViewAdv but I can''t work out how. Can anyone provide me with a simple code example?

5 Replies

AD Administrator Syncfusion Team May 26, 2004 11:05 PM UTC

Hi, 1. Set the RightImagList and LeftImageList properties of the TreeViewAdv to an ImagList. this.treeViewAdv1.LeftImageList = this.imageList1; this.treeViewAdv1.RightImageList = this.imageList1; 2. Set the approproiate ImageIndices value for the left and right images : treeNodeAdv1.LeftImageIndices = new int[] {0}; treeNodeAdv1.RightImageIndices = new int[] {1}; Please refer to the treenodeadvsample_attached that illustrates this. Let me know if you need further assistance. Thanks for choosing Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.


DS Derek Stafford May 27, 2004 07:41 AM UTC

Hi, Still can''t get this to work. LeftImageIndices is not a member of TreeNodeAdv. The nearest thing I could find was TreeNodeAdv.NodeData.LeftImagesIndexes but when I tried this although I received no build or run errors my 16x16 256 colour .ico never appeared. My code is as follows: private System.Windows.Forms.ImageList FolderImages; private void InitializeComponent() { this.FolderImages = new System.Windows.Forms.ImageList(this.components); // // FolderImages // this.FolderImages.ImageSize = new System.Drawing.Size(16, 16); this.FolderImages.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("FolderImages.ImageStream"))); this.FolderImages.TransparentColor = System.Drawing.Color.Transparent; } public SessionRootNode CreateSessionRootNode(string text) { SessionRootNode sessionRootNode = new SessionRootNode(text); // subclass of TreeNodeAdv sessionRootNode.NodeData.LeftImageIndexes = new int[] {0}; return sessionRootNode; } I''ve only just discovered the latest version 2.0 release and am currently downloading it. Is LeftImageIndices specific to version 2? >Hi, > >1. Set the RightImagList and LeftImageList properties of the TreeViewAdv to an ImagList. > >this.treeViewAdv1.LeftImageList = this.imageList1; >this.treeViewAdv1.RightImageList = this.imageList1; > >2. Set the approproiate ImageIndices value for the left and right images : > >treeNodeAdv1.LeftImageIndices = new int[] {0}; >treeNodeAdv1.RightImageIndices = new int[] {1}; > >Please refer to the treenodeadvsample_attached that illustrates this. Let me know if you need further assistance. Thanks for choosing Syncfusion products. > >Regards, >Guru Patwal >Syncfusion, Inc.


AD Administrator Syncfusion Team May 27, 2004 09:44 AM UTC

Hi, The TreeViewAdv control has undergone several changes since v1.6. We strongly encourage you to upgrade to v2.0 as this control is much more stable in terms of fixes and rich in features. LeftImageIndices and RightImageIndices are the TreeViewAdv''s properties (not TreeNodeAdv''s) and these features are available in v2.0 only. Please open an incident in DirectTrac in this regard, and I will send you the download instructions to our latest v2.0 release. We appreciate your cooperation, and thanks for choosing Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.


HF Horselover Fat May 27, 2004 11:56 AM UTC

Guru, Downloaded and installed 2.0.5.1 ok and have now managed to get it working. By the way, your last post stated that ''LeftImageIndices and RightImageIndices are the TreeViewAdv''s properties (not TreeNodeAdv''s)''. This is not correct. They are properties of a TreeNodeAdv. Thought I ought to mention this for other people who may read this topic. >Hi, > >The TreeViewAdv control has undergone several changes since v1.6. We strongly encourage you to upgrade to v2.0 as this control is much more stable in terms of fixes and rich in features. LeftImageIndices and RightImageIndices are the TreeViewAdv''s properties (not TreeNodeAdv''s) and these features are available in v2.0 only. Please open an incident in DirectTrac in this regard, and I will send you the download instructions to our latest v2.0 release. We appreciate your cooperation, and thanks for choosing Syncfusion products. > >Regards, >Guru Patwal >Syncfusion, Inc.


AD Administrator Syncfusion Team May 27, 2004 12:25 PM UTC

Hi, Thanks for the update. My apologies for the incorrect update earlier. I meant to say that the LeftImageLists and RightImageLists are the properties of the TreeViewAdv, and LeftImageIndices and RightImageIndices of the TreeNodeAdv (as illustrated by the code snippets posted in one of my earlier updates). We appreciate your interest in Syncfusion. Regards, Guru Patwal Syncfusion, Inc.

Loader.
Live Chat Icon For mobile
Up arrow icon