Welcome to the Xceed Community | Help
Community Search  
More Search Options

formating cell content using StringFormatConverter truncates the result

Sort Posts: Previous Next
  •  01-13-2012, 6:22 PM Post no. 31557

    formating cell content using StringFormatConverter truncates the result

    using this xaml to ensure a double value is rounded to 2 decimal places
     
                    <xcdg:StringFormatConverter x:Key="stringFormatConverter" />
                    <s:String x:Key="roundDouble">{0:0.00}</s:String>
                    
                    <DataTemplate DataType="{x:Type s:Double}">
                        <TextBlock Text="{Binding Converter={StaticResource stringFormatConverter}, ConverterParameter={StaticResource roundDouble}}" 
                                   HorizontalAlignment="Right" /> 
                    </DataTemplate> 
     
    for example a cell content with -155.234567 should be displayed as as -155.23
    but instead I see this -155...
     
    Its as if the cell thinks it does not have enough room for the string and truncates adding the .. 
     
    What am I doing wrong here or what else do I need to do to ensure the cell displays what I want.
     
    btw my columns are defined dynamically at run time so I cant or its not easy to set the format at compile time using a column definition or a CellContentTemplate
     
     
     
     
  •  01-16-2012, 1:37 PM Post no. 31564 in reply to 31557

    Re: formating cell content using StringFormatConverter truncates the result

    Hi Jonathan, 

     

    Could you send us a sample that demonstrates the problem so that we investigate it in more detail?

    You can send it to support@xceed.com.  Please include a reference to this forum post in your email. 


    Best Regards,

    Michel Dahdah
    Technical Support
    Xceed Software inc.
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.