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

[Solved] Resource Binding to GridView Header

4 Answers 202 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Seth
Top achievements
Rank 1
Seth asked on 08 Jul 2009, 12:10 PM
I'm trying to bind an entry from a resource file (resources.resx) to the gridview column header.  I see that there is a DependencyProperty for the Header but this doesn't seem to be working when I try to bind my value.  I'm using the following code:

<TelerikGrid:GridViewDataColumn x:Name="columnNoteText" Width="*" Header="{Binding Source={StaticResource LanguageResource}, Path=WorkOrderTemplateNotesTabNoteTextColumnLabel}" >

</TelerikGrid:GridViewDataColumn>


Thanks,
Seth Mims

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 08 Jul 2009, 12:37 PM
Hello Seth,

You cannot use Binding in non UI elements - grid columns for example. You can use directly:

Header="{StaticResource LanguageResource}"

or you can check our localization example:

http://demos.telerik.com/silverlight/#GridView/Localization

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Seth
Top achievements
Rank 1
answered on 08 Jul 2009, 01:31 PM
Why is the Header a non-UI element?  I understand where you are coming from but every other control we are using .. including other Telerik controls, we are able to bind to a resource file.  I don't understand why the GridView Header breaks cardinal and follows a different functionality path.  An important requirement we have is that our application be multilingual.  The GridView Header would be the only case where we wouldn't be able to address this in XAML .. therefore causing us to have to write more code.  We'll definitely utilize the GridView all over the application so this would continue to be an issue for us.  Would this be something we could get added as a feature in a future release?  Currently, the Microsoft Grid allows this functionality.

Thanks,
Seth Mims
0
Vlad
Telerik team
answered on 08 Jul 2009, 01:50 PM
Hello Seth,

Grid columns are not UI elements/controls - the column is just a storage for settings.

I've just tried this with MS DataGrid and situation is the same! Can you post working example with MS DataGrid?

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Seth
Top achievements
Rank 1
answered on 08 Jul 2009, 06:57 PM
Hi Vlad,

My mistake .. the Microsoft GridView is in fact NOT working either.  I have a helper method doing the conversion so that is why I made that mistake thinking it was allowing the binding.  I'll look into the Telerik localization samples.

Thanks again,
Seth Mims
Tags
GridView
Asked by
Seth
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Seth
Top achievements
Rank 1
Share this question
or