Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
3
Erster Beitrag:
vor 7 Jahren, 2 Monaten
Letzter Beitrag:
vor 7 Jahren, 2 Monaten
Beteiligte Autoren:
Allard, DerekT

tree view with checkbox

Startbeitrag von Allard am 10.06.2011 20:09

Hi
Iam using the tree control and I ran into a bit of a problem
I added the checkbox to the tree and made tham invisible where i donot need them

I fill the tree with a query

Treeadd( treename. "name of first note" + tab + Query.item )

Ok this works fine so far

but now I want to know if a checkbox after the note (lled by the query )s selected or not. Hmm that is a challage

If a note is static than there is no problem because they are named when added. My query adds items depended on the query. So I cannot do this:

sbranch is string
sbranch is Treeselect

if stringcount( sbrach,tab,fromend) = 1 then // the note of the query is selected

if treename.["name of the first note"+ tab + query.item]..checked = 1 Then

//do my stuff




This doesnot work because the query has serveral items. and I need to now if 1 or more items are checked for I want to print a report based on one or more items ( the items that are checked.)

There is no function to check the checkbos directly. So I gues I have to use somthing like the indentifier ??


I hope you get my problem


Thanks Allard










Antworten:

Hi
I found a bit of a work arround If you want to return a value from a selected checkbox than you can do the follwing

For each query

if tree["first note"+ tab + query.item]..checked = 1 then

trace( query.item)

end

end

It does return the note that is checked but it does it for all the values of the query. But this does return all the checked items. If your note has 10 items and you check for instance 4 items ,fore those are the items you want to use to do something, then all 4 are returned

So then you can get a list with all selected items. But for all the values of the query. so you have to put the values somewhere and strip it.


I solved my problem in an other way but I wanted to share this with you since quite a view people read this topic



von Allard - am 15.06.2011 10:21
Allard
Have you cosidered using a Treeview Table?
You can y playing around in the Style tab make it look like a standard treeview but iy give the advantage of being able to do programming\selection etc as you would for a standard table.

I find these to be much easier to use in the long run.

Derek

von DerekT - am 15.06.2011 14:56
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.