473,473 Members | 1,894 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Remove checkboxes from child items level (TreeView)

Hi,

I would like to ask how to display checkboxes in TreeView on the first top
level only. When I expand the top level node (node with a checkbox), I want
those nodes to be without a checbox.

One way would be to make a new ImageList where would be a transparent bitmap
for "none" checkbox along with all other images needed to show checkbox for
top level nodes.

Is there any simpler way? A property would be nice, but I haven't found any.

Thanks,

Lubomir
Aug 2 '06 #1
1 5673
Basically you set the state image index to 0 for the nodes were you don't
want the checkbox. However, the TreeNode.StateImageIndex property is of no
use because it ignores any attempts to set it if CheckBoxes are set to true
so you'll need to use P/Invoke. Try this:
http://groups.google.se/group/micros...0571018c?hl=sv

/claes
"Lubomir" <Lu*****@discussions.microsoft.comwrote in message
news:5F**********************************@microsof t.com...
Hi,

I would like to ask how to display checkboxes in TreeView on the first top
level only. When I expand the top level node (node with a checkbox), I
want
those nodes to be without a checbox.

One way would be to make a new ImageList where would be a transparent
bitmap
for "none" checkbox along with all other images needed to show checkbox
for
top level nodes.

Is there any simpler way? A property would be nice, but I haven't found
any.

Thanks,

Lubomir

Aug 3 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Michael A. Covington | last post by:
Can somebody point me to an example of how to put checkboxes on a treeview? I want to set up something that is very much like the way tape backup programs let you select a set of files and/or...
1
by: Trevor | last post by:
How can I recursively loop through _every_ TreeNode in a TreeView using C#? The CheckBoxes property enables checkboxes for all TreeNodes. I only want checkboxes on TreeNodes that have 0 child...
0
by: Karthick Kumar | last post by:
Hi, I need to create a simple parent/child hierarchical menu. I have alread used the Treeview control but my requirement is slightly different than the Treeview control. I already have the kind...
0
by: Garet Cammer | last post by:
Hi Everyone, I'm having some trouble with making a TreeView do what I want when its checkboxes property is true. It is being used in a DotNet Desktop Windows Application for file selection,...
7
by: amruta | last post by:
the code below dows not let me get the parent child view... all the nodes are show in one line only... also i need them to be collasped ... Thanks ..
2
by: Jack | last post by:
Hello, I am trying use a TreeView with checkboxes. I would like to check more than one node and allow all child nodes of selected nodes to be checked or unchecked with the parent is checked. ...
0
by: pushpi | last post by:
Hi, i'm using the Treeview contol in asp.net 2.0 (present in VS2005 toolbox). i'm having checkboxes for all the nodes in the treeview.All i want to have is that On Checking a checkbox for a...
0
by: divya1949 | last post by:
Create a windows c# application which will Read a xml file and populate nodes in the treeview. 1 On selection of treenode display the child nodes of that node in listview control 2. ...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.