Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conditionally making readonly to WPF DataGridCell

I have a situation that needs to conditionally make readonly to wpf datagrid cell. There is IsReadOnly property in DataGridCell. But unfortunately, that property is readonly! Is there any way to do it?
ant.

like image 788
Ant Avatar asked Jun 01 '10 03:06

Ant


1 Answers

You should be able to use the DataGrid.BeginningEdit event to conditionally check if the cell is editable and then set the Cancel property on the event args if not.

like image 192
Josh Avatar answered Sep 21 '22 07:09

Josh



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!