I would like to handled SelectionChanged event in WPF DataGrid element for user interaction/selection only and skip if it’s due to binding or other set values. Any idea how I will determine if the Selection is changed by user interaction? Or any alternate event that would do similar task?
I would like to handled SelectionChanged event in WPF DataGrid element for user interaction/selection
Share
Maybe try combine
SelectionChangedevent withPreviewMouseDownevent. When user click a row you set some property and inSelectionChangedevent handler check if than property was changed.Sample code XAML:
Code behind: