Reputation: 5488
Is it possible to somehow make 0 values appear blank using the StringFormat property, or is it acheivable by writing a custom converter?
The value is of double type.
Input is 0, output should be "". But when input is other than 0 then output should equal input.
EDIT:
I tried :
sdk:DataGridTextColumn x:Name="colBidQty" Header="Bid Qty" Binding="{Binding BidPrice.Quantity, Mode=TwoWay, StringFormat="{}{0:#}"}" Foreground="Black" ToolTipService.ToolTip="{Binding Path=BidPrice.ToolTip}" ToolTipService.Placement="Right" />
Upvotes: 0
Views: 395
Reputation: 33364
To sum up comments, you can specify StringFormat
as {0:#}
which will replace 0 with empty string:
Binding="{Binding BidPrice.Quantity, Mode=TwoWay, StringFormat='{}{0:#}'}"
Upvotes: 1