Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3160
Correct syntax for using a converter?
posted

The convert method is not called when using:

 

 

 

 

 

 

 

 

 

 

<

 

 

 

igDP:Field Name="BROKER" Label

="Broker" >

 

 

 

 

<igDP:Field.Settings

>

 

 

 

 

<igDP:FieldSettings

>

 

 

 

 

<igDP:FieldSettings.CellValuePresenterStyle

>

 

 

 

 

<Style TargetType="{x:Type igDP:CellValuePresenter

}">

 

 

 

 

<Setter Property="Background" Value="{Binding BROKER, Converter={StaticResource BrokerColorConverter

}}"/>

 

 

 

 

</Style

>

 

 

 

 

</igDP:FieldSettings.CellValuePresenterStyle

>

 

 

 

 

</igDP:FieldSettings

>

 

 

 

 

</igDP:Field.Settings

>

 

 

 

 

</igDP:Field

>

 

  • 138253
    Offline posted

    Hello Sam,

     

    I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.

  • 138253
    Verified Answer
    Offline posted

    Hello,

     

    Thank you for your post. I have been looking into it and the code you have provided and I suggest you use the following one instead of yours:

    <igDP:Field Name="BROKER" Label="Broker">
        <igDP:Field.Settings>
            <igDP:FieldSettings>
                <igDP:FieldSettings.CellValuePresenterStyle>
                    <Style TargetType="{x:Type igDP:CellValuePresenter}">
                        <Setter Property="Background" Value="{Binding DataItem.BROKER,Converter={StaticResource BrokerColorConverter}}"/>
                    </Style>
                </igDP:FieldSettings.CellValuePresenterStyle>
            </igDP:FieldSettings>
        </igDP:Field.Settings>
    </igDP:Field>
    

     

    The difference is in the Binding’s Path, because the Binding’s DataContext is DataRecord. Please let me know if this helps you or you need further assistance on this matter.

     

    Looking forward for your reply.