views:

144

answers:

1

Hello there.

Is there any way I can bind some datacontext's property value to the IsReadOnly property?

e.g:

<toolkit:DataGridTemplateColumn Header="MyColumn" Width="160" IsReadOnly="{Binding Path=BooleanPropertyFromMyViewModel, Converter={StaticResource InvertBoolConv}}"/>

Or should I create a DataTrigger?

A: 

I don't have the toolkit installed on this machine, but if IsReadOnly is a dependency property, that should work just fine.

Once I have access to may main development machine, I'll confirm it, but if you're not seeing the behavior you expect from it I would check the output window for any binding errors.

If you're using WPF 4, you can use Tracing as described in Pete Brown's blog post here.

Ben Von Handorf