RadGridView GridViewDataColumn Multiple DataFormatString

5 posts, 0 answers
  1. ShinichiKudo
    ShinichiKudo avatar
    8 posts
    Member since:
    Aug 2014

    Posted 27 Aug 2014 Link to this post

    Hi All,
    I want to multiple  format string for GridViewDataColumn.
    I use code:
    <telerik:GridViewDataColumn DataMemberBinding="{Binding Fee}" Header="{StaticResource lblFeeTransaction_1}"  DataFormatString="{Binding ModelData.NumberFormat}"/>
    It's not working with DataFormatString="{Binding ModelData.NumberFormat}"
    I want format string at interface.
    Please help me... Thanks you very much!
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 27 Aug 2014 Link to this post

    Hi,


    Thank you for contacting us. 

    You could take a look at the following forum thread, where similar issue was discussed. 

    Hope this helps. 

    Regards,
    Vanya Pavlova
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. DevCraft banner
  4. ShinichiKudo
    ShinichiKudo avatar
    8 posts
    Member since:
    Aug 2014

    Posted 28 Aug 2014 Link to this post

    Hi,
    I watch  forum thread, but i don't quite understand
    can you make an example?
    Thanks you!
  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 02 Sep 2014 Link to this post

    Hello,

    You can bind the DataFormatString. You just need to ensure you pass a valid Source for the Binding.
    For example:
    <Window.Resources>
        <local:SampleData x:Key="myData"/>
    </Window.Resources>
    <telerik:GridViewDataColumn DataFormatString="{Binding TimestampFormatString, Source={StaticResource myData}}" DataMemberBinding="{Binding CreationTimestamp}"/>

    In the forum thread, my colleague suggested that you use a converted for the Binding and return the correct value for the format you would like to apply. That way you can apply a custom logic to a binding. You can refer to the example in msdn (IValueConverter).

    Regards,
    Didie
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  6. ShinichiKudo
    ShinichiKudo avatar
    8 posts
    Member since:
    Aug 2014

    Posted 02 Sep 2014 Link to this post

    it's working very good... Thanks you for all :)
Back to Top
DevCraft banner