I try to use the IsReadOnly property via binding, but the cell remains editable.
I've got something like this:
<ig:TextColumn Key="MyModel.Value1" IsReadOnly="{Binding Path=MyModel.Enabled1}">
Where Enabled1 is a property of type bool, value true within MyModel.
I tried to add a (dummy-)converter but that didn't do the trick neither...When I change the Key property to MyModel.Enabled1 the grid will correctly show 'True'.
Any suggestions?Thanks!
Hi Steve
Thanks for your immediate answer. I'll go for option 2.
Cheers, Hoschi
Hi Hoschi,
So, there isn't currently a way to control whether a Cell is Editable on a cell by cell level. Only a column.
Although we're currently thinking about this feature, it hasn't been added yet. So for now, you have 2 options.
1. Make the cells you don't want to edit, as IsEnabled = false
2. Use the CellEnteringEditMode event and cancel it for the cells that are not editable.
Hope this helps,
-SteveZ
This won't solve my problem since each row contains cells that can individually be editable or not.
E.g.row 1 allows cells 1 and 2 to be modified while 3 and 4 are lockedrow 2 allows cells 3 and 4 to be modified while 1 and 2 are locked...
Meanwhile I tried it to achieve it by code (InitializeRow event), but when I changed the CellStyle of a cell it changed the styles in all rows.
And another approach was to create an inherited EqualToConditionalFormatRule based on the expression Value true or false, but I'm kind of stuck here as well...
Are there smart possibilities to solve this problem? Locking cells by setting a style based on a FormatRule (with non-static binding) would be a very elegant solution ;-)
Thanks so far, Hoschi
Hi,
A Column object isn't an actual visual element, which means it doesn't participate in normal DataContext inheritance or even ElementName bindings.
So you'll have to set the Source of the binding yourself to a StaticResource