StringFormat not working for GridViewDataColumn header

2 posts, 0 answers
  1. Kristoffer
    Kristoffer avatar
    158 posts
    Member since:
    Dec 2012

    Posted 06 May 2013 Link to this post

    <telerik:GridViewDataColumn DataFormatString="N0" DataMemberBinding="{Binding MyValue}" Header="{Binding MyLabel, StringFormat=This {0}}" />

    "This " is not shown in my header. What am I doing wrong?
  2. Dimitrina
    Dimitrina avatar
    3769 posts

    Posted 08 May 2013 Link to this post


    Unfortunately, you cannot format the Header that way.

    You can do it defining it like so:

    <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}">
            <TextBlock Text="{Binding HeaderName, StringFormat='This {0}', Source={StaticResource MyViewModel}}"/>

    I hope this helps.

    Kind regards,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top