question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] How can I select multiple `TreeView` entries?

See original GitHub issue

I am trying to implement a tree view with something similar to the approach Windows takes in explorer where every entry has a checkbox. It seems like by default that functionality is not yet available - is there a workaround that I can use to enable the tree view to use checkboxes?

This is related to the MultiSelect property, but with a different UI presentation.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
tigcommented, Oct 14, 2022

Closing this question as I believe it was sufficiently answered.

0reactions
BDispcommented, Aug 22, 2022

Its doable, theres also lots of customizations I can think of e.g.

* If you click a checkbox for a branch should it tick all leaf items

Yes, if the branch isn’t selected or only some leaf items are selected (solid state on the branch), clicking a checkbox it will mark all leaf items. On the other hand, if the branch is already selected clicking a checkbox will unmark all the leaf items.

* Ticking a branch should tick unrevealed items the whole way down the tree even though `TreeView<T>` does 'just in time' branch discovery.  So methods like 'GetAllCheckedObjects' would just return the exposed ones.

I agree, Should tick or unpick unrevealed items the whole way down the tree, dependent of the current state. Method only have to return the exposed ones (expanded).

Its pretty tough but doable.

I know, thanks for your attention. To be more tough, only display the checkbox if a property like ShowCheckbox or similar is enable. If MultiSelect and ShowCheckbox properties are enabled it acts like the above. If MultiSelect is enabled and ShowCheckbox is disabled, then the selected items will be displayed by the selected or u-selected color. If MultiSelect is disabled and ShowCheckbox is enabled clicking a branch checkbox will not tick all leaf items, but only the branch itself. If another item is clicked then the previous item must be deselected. If MultiSelect and ShowCheckbox properties are disabled it acts like currently does. If all of this doesn’t make any sense for you, then forget it 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it possible to select multiple rows in a treeview widget?
Yes, it is possible to get a tuple of the selected items using selection() method. Once you get the tuple, you can access...
Read more >
Multiple Rows Select - Treeview Python [Awaited Video]
How to Sum of Selected rows / Different Rows Selection in tkinter treeview, Most awaited video. you may check the last video for...
Read more >
How to correctly select multiple items with the mouse in ...
You can select multiple rows at a time by pressing the Ctrl key and selecting the row from the table. Dev Prakash Sharma....
Read more >
Can I select multiple nodes in a TreeView Control?
The Treeview control does not support multiple selections but there are samples posted at GotDotNet which demonstrates how this feature can be implemented....
Read more >
Tkinter Treeview how to correctly select multiple items with the ...
Answer a question I'm trying to use the mouse to select and deselect multiple items. I have it working sort of but there...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found