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.

Treeview node images

Thread ID:

Created:

Updated:

Platform:

Replies:

21460 Nov 10,2004 05:38 PM Jun 6,2008 08:13 AM Windows Forms 4
loading
Tags: Tools
Richard
Asked On November 10, 2004 05:38 PM

How can I set the treenode images to whatever I want. I can set the curent image of a node using. nod.LeftImageIndices = new int[] {41}; //closed folder. Most other constrols use image lists and an image index to specify the image for a control, is there something similar. Or something to set the image using a file eg. nod.image = "test.ico";

Administrator [Syncfusion]
Replied On November 11, 2004 05:56 PM

Hi Rich, We do not have an "Form.Icon" like property associated with the TreeNodeAdv, but you could use the following approach if you wish to directly assign image files to the TreeNodeAdvs : Bitmap bmp1 = new Bitmap("..\\..\\shape9.ico"); Bitmap bmp2 = new Bitmap("..\\..\\shape10.ico"); Bitmap bmp3 = new Bitmap("..\\..\\shape11.ico"); Bitmap bmp4 = new Bitmap("..\\..\\shape12.ico"); Bitmap bmp5 = new Bitmap("..\\..\\shape13.ico"); this.imageList1.Images.Add(bmp1); this.imageList1.Images.Add(bmp2); this.imageList1.Images.Add(bmp3); this.imageList1.Images.Add(bmp4); this.imageList1.Images.Add(bmp5); int count=0; foreach (TreeNodeAdv node in this.treeViewAdv1.Nodes) { node.LeftImageIndices = new int[] {count}; node.RightImageIndices = new int[] {count}; count++; } Please refer to the test sample attached here and let me know if this meets your requirements. Thanks for your interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Richard
Replied On November 11, 2004 09:06 PM

Thanks Guru, this will do nicely

Bill Rhodes
Replied On June 5, 2008 03:08 AM

Hey how can I do this for the asp.net tree?

>Thanks Guru, this will do nicely


Melba Winshia [Syncfusion]
Replied On June 6, 2008 08:13 AM

Hi Billy,

If your intention is to set images to the TreeNode of Syncfusion asp.net Treeview control, then please refer below link to get more details on this issue:

http://www2.syncfusion.com/ug_63/toolsweb/ImageSettings.html

And also, please refer the below sample:

http://www2.syncfusion.com/samplebrowser/tools.web/samples/2.0/treepackage/treeview-%20basic%20features/nodecheckboxes/cs/NodeCheckBoxes.aspx

Please try this and let me know if this helps.

Thanks,
Melba



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.

;