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

Grids for WPF Forum

The latest build of this product (v22.1.4) was released 25 days ago, which was before this thread was created.
Posted 24 days 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 22 days 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 22 days ago by Ethem Acar
Avatar

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

[Modified 22 days ago]

Add Comment

Please log in to a validated account to post comments.