Search code examples
wpfvb.nettelerik

Display blank instead of zero in RadGridView data column


Is there a way to display blank instead of zero values for percents?

This is displayed currently:

enter image description here

This is the desired display:

enter image description here

Xaml formatted like this currently:

<telerik:GridViewDataColumn DataMemberBinding="{Binding pPromoDiscountPct, StringFormat='{}{0:P2}'}" Header="Promo Discount %">

I tried several variations of StringFormat but end up with either just a % or nothing at all. Thanks for your help.


Solution

  • My Friend can you try this

    <telerik:GridViewDataColumn DataMemberBinding="{Binding pPromoDiscountPct, StringFormat='{}{0:#%;#%;}'}" Header="Promo Discount %">
    

    What does it mean {0:PositiveFormate;NegativeFormate;ZeroFormat} Hope it will help you. I kept empty in zero section.