473,386 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

TreeView CheckBoxes, but not their children.

I'm writing an app in C# .net 2.0. I want to have a TreeView where the first
level of nodes would have check boxes, but their subsequent children would
not have check boxes.

Is this achievable using the .net controls? If not, how can I make this
possible?

Thanks,
Justin
Dec 6 '05 #1
4 2088
Hi Justin,

Thanks for your post.

Normally, there is no build-in support for this in .Net, however, we can
p/invoke Win32 SendMessage API to send TVM_SETITEM message to the treeview
control to turn off certain node's checkbox. For more information, please
refer to my original reply in the link below:
http://groups.google.com/group/micro...rk.windowsform
s/browse_frm/thread/d3cf518369b6d58a/69a62ef36dcd8eb8?lnk=st&q=checkbox+tree
view+%22Jeffrey+Tan%22&rnum=4&hl=zh-CN#69a62ef36dcd8eb8

Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Dec 7 '05 #2
Thank you!

This is a hack, but it works.

""Jeffrey Tan[MSFT]"" wrote:
Hi Justin,

Thanks for your post.

Normally, there is no build-in support for this in .Net, however, we can
p/invoke Win32 SendMessage API to send TVM_SETITEM message to the treeview
control to turn off certain node's checkbox. For more information, please
refer to my original reply in the link below:
http://groups.google.com/group/micro...rk.windowsform
s/browse_frm/thread/d3cf518369b6d58a/69a62ef36dcd8eb8?lnk=st&q=checkbox+tree
view+%22Jeffrey+Tan%22&rnum=4&hl=zh-CN#69a62ef36dcd8eb8

Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Dec 8 '05 #3
You are welcome

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Dec 9 '05 #4

Why would the ASP.net treeview control allow for checkboxes at the node
level (node.ShowCheckBox) but the VB .net treeview does not? Seems to
me like the controls should all be consistent. Is there any chance
this has been changed in a Service Pack for Visual Studio? I sure could
use it.
--
dlcarp
------------------------------------------------------------------------
dlcarp's Profile: http://www.hightechtalks.com/m620
View this thread: http://www.hightechtalks.com/t2303114

Dec 29 '05 #5

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...
1
by: nicholas | last post by:
I am using Obout TreeView: www.obout.com I would like to implement a page to add and remove categories to a product with the Obout Treeview with checkboxes. Does anyone allready did this and...
3
by: Jan Wrage | last post by:
Hi! I would like to implement a treeview in my existing application. It should show my entire Active-Directory structure, i.e. all Groups, Containers and OUs. Could somebody help me with...
8
by: Don Wash | last post by:
Hi There! I'm using VB.NET to create a TreeView application and unfortunately I could not find "Key" property in Node items of the TreeView. We used to have "Key" property in TreeView node...
12
by: Bob Hollness | last post by:
Hi. I have a text file containing a list of files and their path. I.e. c:\MyDocs\File1.txt c:\MyDocs\File2.txt c:\MyDocs\File3.txt c:\MyDocs\File4.txt C:\MyDocs\Folder\File1.txt
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. ...
1
by: JRSofty | last post by:
Hi everyone, I've gotten myself is bit of a mess where I'm loading a treeview. Basically I initialize the treeview control with a single root node we'll call it root. I do this by using the...
2
by: =?Utf-8?B?QU5V?= | last post by:
I have a tree view which i load completely at the time of my webpage load. When i click on the + signs of the parent nodes, it expands to show all of its children. Similarly, when i click on the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.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...

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.