I have a datagrid in which i manually specify the columns (AutoGenerateColumns="false"). I'm using MVVM and I would like to bind the column header (the text) so that I get it from my ViewModel. But I can't find a way to do that.
The closest thing I've found is this: http://stackoverflow.com/questions/652240/wpf-toolkit-bind-datagrid-column-header-to-dynamicresource ...which is a "trick" with which you can bind the column header to a string statically declared in XAML. But I need to get it from my ViewModel.
The reason I want to this is that the text I want to use as column header will be shown in several places throughout the GUI. To get make sure it actually is the same everywhere I want to have it available in code. And I can't store the strings in a XAML resource file because I also need access to these strings in code.
I'm using a RadGridView from TeleRik, but I guessing I'd have the same problem if I the standard gridview.
Any tips appreciated! Thanks!