The Goal is to color the cell CDvi_CodDvi : red if CDvi_CodCli = 0 and blue if not .
The following Xaml dot work ( i work with thee sample of infragistic )
The converter : passingToColorConverter is good.
Where is the error
thank you Caiseodev
<igDP:XamDataPresenter Name="XDPDevis" SelectedItemsChanged="XDPDevis_SelectedItemsChanged" RecordActivated="XDPDevis_RecordActivated">
<igDP:XamDataPresenter.FieldSettings>
<igDP:FieldSettings AllowEdit="False" />
</igDP:XamDataPresenter.FieldSettings>
<igDP:XamDataPresenter.FieldLayoutSettings>
<igDP:FieldLayoutSettings AutoGenerateFields="False"/>
</igDP:XamDataPresenter.FieldLayoutSettings>
<igDP:XamDataPresenter.FieldLayouts >
<igDP:FieldLayout >
<igDP:FieldLayout.Fields>
<igDP:Field Name="CDvi_CodDvi" Label="Code" Width="70" >
<igDP:Field.Settings>
<igDP:FieldSettings CellWidth="70" LabelWidth="70">
<igDP:FieldSettings.CellValuePresenterStyle>
<Style TargetType="{x:Type igDP:CellValuePresenter}">
<Setter Property="Background"
Value="{Binding Path=Cells[CDvi_CodCli].Value, Converter={StaticResource passingToColorConverter}}">
</Setter>
</Style>
</igDP:FieldSettings.CellValuePresenterStyle>
</igDP:FieldSettings>
</igDP:Field.Settings>
</igDP:Field>
<igDP:Field Name="CDvi_CodCli" Label=" Client" Width="30"></igDP:Field>
<igDP:Field Name="NomCli" Label=" Client" Width="120"></igDP:Field>
<igDP:Field Name="CDvi_DatDvi" Label="Date" Width="70"></igDP:Field>
<igDP:Field Name="CDvi_DesDvi" Label="Designation" Width="150"></igDP:Field>
</igDP:FieldLayout.Fields>
</igDP:FieldLayout>
</igDP:XamDataPresenter.FieldLayouts>
</igDP:XamDataPresenter>
Hello,
Thank you for the post. I have been looking into your question and I am attaching a sample application(DynamicStyling.zip) where I have shown how you can achieve the desired functionality.
If you need any further assistance on this matter, feel free to ask.
Thank you so much. It's Work fine.
Just other question :
<Setter Property="Background" Value="{Binding Path=Value, RelativeSource={RelativeSource Self}, Converter={StaticResource doubleToColorConverter}}"/>
In this line : what means : RelativeSource={RelativeSource Self},
CaiseOdev