I want to localize my GridView from xml file which has translation for my GridView headers.
I use next code:
<
Window.Resources
>
<
Style
TargetType
=
"telerik:GridViewDataColumn"
>
<
Setter
Property
=
"Header"
Value
=
"someValue"
/>
</
Style
>
</
Window.Resources
>
<
Grid
>
<
telerik:RadGridView
HorizontalAlignment
=
"Left"
Name
=
"radGridView1"
VerticalAlignment
=
"Top"
>
</
telerik:RadGridView
>
</
Grid
>
public
partial
class
Window1 : Window
{
public
Window1()
{
InitializeComponent();
var lst =
new
List<Foo>
{
new
Foo() {CompanyName =
"Burkinafaso"
, Phone =
"6666"
},
new
Foo() {CompanyName =
"Reebok"
, Phone =
"555"
}
};
radGridView1.SetBinding(RadGridView.ItemsSourceProperty,
new
Binding {Source = lst});
}
}
public
class
Foo
{
public
string
CompanyName {
get
;
set
; }
public
string
Phone {
get
;
set
; }
}
But Headers not change. Why I cannot change headers with this approach?
I am planning to bind TextBlock to the XmlNode value and get appropriate translation by Header system name