Page 1 of 1

Preventing user selecting items in a ListView

Posted: 16 Mar 2021, 21:16
by peterh
In WPF, the SelectionMode property of ListView has a possible value of "None" to prevent a user from selecting items in the ListView. This value seems to be missing in the Noesis.SelectionMode enum. Is there a workaround for this?

Re: Preventing user selecting items in a ListView

Posted: 16 Mar 2021, 21:25
by peterh
Turns out the None value is a UWP thing, but the question how to work around there not being one still stands.

Re: Preventing user selecting items in a ListView

Posted: 17 Mar 2021, 20:27
by sfernandez
Could be an option to disable the ListViewItems? You can do that in the ItemContainerStyle for the ListView.
If not you can always handle the PreviewMouseDown in the ListView to avoid the selection.

Please let me know if that works for you.