Hi,
we want to set the background for a column header when the appropriated column is set disabled.
The style for the CellValuePresenter looks like this:
<Style x:Key="AbrechenbareLeistungLkzCellValueStyle" BasedOn="{StaticResource EditableCellValuePresenterStyle}" TargetType="{x:Type igDP:CellValuePresenter}"> <Style.Triggers> <DataTrigger Binding="{Binding Path=DataItem.IsLkzLocked}" Value="True"> <Setter Property="IsEnabled" Value="False" /> <Setter Property="Opacity" Value="0.8" /> </DataTrigger> </Style.Triggers> </Style>
We have already retemplate the LabelPresenter. Can we check the enable state of the CellValuePresenter from the LabelPresenterStyle or is there another way to achieve this behavior?
Best regards
Lukas
<Style TargetType="{x:Type igWPF:LabelPresenter}"> <Setter Property="Background" Value="LightGray"/> <Style.Triggers> <DataTrigger Binding="{Binding Path=Field.IsEnabled, RelativeSource={RelativeSource Self}}" Value="False"> <Setter Property="Background" Value="LightSkyBlue"/> </DataTrigger> </Style.Triggers> </Style>
Hi Teodosia,
thanks for the approach but we are working in a MVVM environment, so we have to implement it via binding.
In your sample the field is set disabled in code behind.
your sample helped us a lot. Thank you very much.
Hello Lukas,
I am glad that you find my suggestion helpful.
Thank you for using Infragistics components.