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
165
If value is 0 then display blank
posted

I have written an Ivalueconverter that will convert any double or integer into an empty string if the value is 0. 

I just can't figure out how to apply it.

    <Window.Resources>

        <controls:DisplayZeroAsBlank x:Key="DisplayZeroAsBlank"/>

    </Window.Resources>

 

....

            <Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="zero">

                <Setter Property="Value">

                    <Setter.Value>

                        <Binding Converter="{StaticResource DisplayZeroAsBlank}"></Binding>

                    </Setter.Value>

                </Setter>

            </Style>

...

                            <igDP:Field Name="OurAsk">

                                <igDP:Field.Settings>

                                    <igDP:FieldSettings CellValuePresenterStyle="{StaticResource zero}" />

                                </igDP:Field.Settings>

                            </igDP:Field>

How should this be done?

Parents
No Data
Reply
  • 69686
    Suggested Answer
    posted

    Hello,

    If you want to display an empty string when a value is zero, it is best to use an IValueConverter and apply it at the ValueToDisplayTextConverter property of the editor. You can create a style for the editor of the specific field and apply it at the Field -> Settings -> EditorStyle property. Another way would be to apply the converter to the Converter property of the Field.

Children
No Data