Hi all,
I have a XamDataGrid and a Grid wich DataContext is Bound to the dataGrid´s ActiveDataItem. The Grid contains some controls with properties that depend on values of some fields.
For example, the Content of a Label should change depending on a value. I have code the Trigger:
<Label>
<Label.Triggers>
<Trigger Property="DataContext.Cells[MyField].Value" Value="True">
<Setter Property="Content" Value="MyText"/>
</Trigger>
</Label.Triggers>
</Label>
When compiling I get a DataContext.Cells[MyField] Property Not Found Error.
Any Idea?
Thanks in advance.
Hello,
If you are binding to the ActiveDataItem, then you will not have cells. The ActiveDataItem is the underlying object and you can bind to its properties directly. Probably you want to bind to the ActiveRecord which exposes cells?
It is bound to the ActiveRecord. Sorry for the mistake.