Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF MVVM Light enabling button if data grid row is selected

I can't seem to find a straight answer on this anywhere. I have a button that I want to Disable UNTIL a DataGrid row is selected. Doesn't matter which row. Once it's deselected I would like it to be disabled again.

like image 577
JTester Avatar asked Jan 19 '26 14:01

JTester


1 Answers

It's much easier to just use the automatic evaluation of int to bool provided by WPF:

IsEnabled="{Binding ElementName=YourDataGrid, Path=SelectedItems.Count}"
like image 146
KuhTee Avatar answered Jan 21 '26 08:01

KuhTee



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!