Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPF MVVM: how to detect when CheckBox column of DataGrid is checked/unchecked

$
0
0

I have a View with a Datagrid bound to an ObservableCollection in a ViewModel. One of the Datagrid columns is a DataGridCheckBoxColumn (BTW: as recommended by several posts, I also tried using a CheckBox inside a DataGridTemplateColumn, but that doesn't work either). 

I need to enable a button on the same View (but which is not part of the DataGrid) if any checkbox in the DataGrid is checked, and to disable the button if none are checked.

And this needs to be done declaratively via binding to the ViewModel, without using any (View) code-behind.

Seemed simple enough, until I tried it.

Ideas?

DadCat


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>