Set the DataFormatString using style/resource

4 posts, 0 answers
  1. Scott Waye
    Scott Waye avatar
    111 posts
    Member since:
    Nov 2009

    Posted 02 Sep 2010 Link to this post

    Hi,

    Is it possible to set the DataFormatString using a style or a StaticResource?  It would be good to specify the format for certain columns in one place and just reference that format in the xaml.

    --
    Scott
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 03 Sep 2010 Link to this post

    Hello Scott Waye,

    You may define the DataFormatString as a string Resource as follows:

    <UserControl.Resources>    
        <sys:String x:Key="DataFormatString">{0:P}</sys:String>                
    </UserControl.Resources>

    <telerik:GridViewDataColumn DataMemberBinding="{Binding Number}"                                                                    DataFormatString="{Binding Source={StaticResource DataFormatString}}"/>

     

    Regards,
    Maya
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Sandi Markon
    Sandi Markon avatar
    101 posts
    Member since:
    Jul 2012

    Posted 22 Sep 2010 Link to this post

    Thanks, but this is not my scenario! I'd like to localize format string from string resource not static from XAML! How???
  5. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 22 Sep 2010 Link to this post

    Hi Sandi Markon,

    Localization of the Caption of an AggregateFunction may be performed by the help of LocalizationManager. More information may be found in this forum thread.
     

    All the best,
    Maya
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top