TreeListBox SelectedItems is ReadOnly can't bind with MVVM structure.

Grids for WPF Forum

Posted 2 years ago by Ethem Acar
Version: 22.1.4
Avatar

TreeListBox SelectedItems is ReadOnly can't bind with MVVM structure.

I still made it possible to receive the SelectedItems in my ViewModel with the help of: https://stackoverflow.com/a/7227295/13164285

Meanwhile my question is why is it ReadOnly and how could it be better implemented in MVVM way without bypassing the whole MVVM structure like Fredrik Hedblad's solution.

Comments (2)

Answer - Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

In our samples, each TreeNodeModel has a boolean IsSelected property on it.  All you have to do is change that, and it will update TreeListBox.SelectedItems appropriately.


Actipro Software Support

Posted 2 years ago by Ethem Acar
Avatar

Totally forgot about that property. Indeed that's an easier and correcter approach.

[Modified 2 years ago]

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.