Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use checkboxes in treeview

Status
Not open for further replies.

FoxKid

MIS
Jun 8, 2003
92
IN
Hi all,
I want to know that what is the role of checkboxes in treeview and how does it work?

I want to get the list of items I have selected by checkboxes. Can I do it? if yes....how?

Thanks and Regards
 
Hi FoxKid,

This is very simple. Each node object has a Checked property which is .T. if the checkbox is ticked. So you can loop through the nodes collection, something like this:

FOR EACH loNode IN THISFORM.MyTreeView.Nodes
IF loNode.Checked
* This node is checked
ENDIF
ENDFOR

Does that meet your needs?

Mike


Mike Lewis
Edinburgh, Scotland
 
Hi Mike,

Thanks for your reply...this will solve my problem

but 2 more question arise in my mind......

1. If we tick mark parent node then its all child nodes should also be marked as true. Because if we selected a parent then all its childs should also be marked as true automatically. Why is it not so? or how can we do so

2. Is there any other single line command to get all checked checkbox values to any cursor so that it become easy to do query with other tables.

What you have suggested will also solve my problem. But I think it will take me long to come to the target. As first of all I will have to make readwrite cursor and store all the checked valued one by one from it and then query it with other tables to generate reports.

Thanks and Regards
 
Thankyou Mike for your help and reply.

Thanks and Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top