This is a migrated thread and some comments may be shown as answers.

Binding value from resource.resx to Header of DataGridTemplateColumn

1 Answer 91 Views
GridView
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 27 Oct 2011, 10:16 AM
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

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 27 Oct 2011, 10:22 AM
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 >>

Tags
GridView
Asked by
John
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or