Binding value from resource.resx to Header of DataGridTemplateColumn

2 posts, 0 answers
  1. John
    John avatar
    32 posts
    Member since:
    Sep 2011

    Posted 27 Oct 2011 Link to this post

    I get an error:


        Cannot find a Resource with the Name/Key ResourceString [Line: 94 Position: 104]



    in my xaml:


        <data:DataGridTemplateColumn x:Name="PriorityColumn" CanUserSort="True" Header="{Binding columnHeader_PriorityColumn, Source={StaticResource ResourceString}}">



    But I can't bind element from resource to texblock


    After some investigation I figured out that it's because I can only user Resource.resx to controls listed at:


    http://msdn.microsoft.com/en-us/library/dd882554(v=vs.95).aspx


    So if I have right, is there other way to bind value do header of DataGridTemplateColumn?

    columnHeader_PriorityColumn

    I have  overround for this by setting header in codebehind

    private ResourceManager _rm = new ResourceManager("MyApp.Resources.MessagingStrings", System.Reflection.Assembly.GetExecutingAssembly());
    grdArchive.Columns[2].Header = _rm.GetString(
    "<span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: monospace; white-space: nowrap; ">columnHeader_PriorityColumn</span>");


    But I need to have it in xaml.

    Best regards

  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 27 Oct 2011 Link to this post

    Hi,

     This forum is for questions related to Telerik RadGridView. Please post your questions related to standard Silverlight DataGrid on official Microsoft forums!

    Best wishes,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top