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

Grids for WPF Forum

Posted 1 year 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 1 year 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 1 year ago by Ethem Acar
Avatar

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

[Modified 1 year ago]

The latest build of this product (v24.1.1) 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.