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

Changing the column header at runtime

4 Answers 70 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sameh
Top achievements
Rank 1
Sameh asked on 28 Sep 2009, 06:36 AM
I have a WPF page with a RadGridView, and i want to change the column headers of this grid at runtime beacuse my application is bilingual, i tiried the following code but the headers dose not changed.

<

 

telerik:RadGridView Name="gvEmployees" Margin="2" telerik:StyleManager.Theme="Office_Blue" AutoGenerateColumns="False" HorizontalAlignment="Stretch" ColumnsWidthMode="Fill" ShowGroupPanel="False" IsReadOnly="True">

 

 

 

<telerik:RadGridView.Columns>

 

 

 

<telerik:GridViewDataColumn DataMemberPath="Employee_NO" Header="Employee NO."/>

 

 

 

 

<telerik:GridViewDataColumn DataMemberPath ="National_ID" Header="National ID"/>

 

 

 

<telerik:GridViewDataColumn DataMemberPath="Full_Name_Ar" Header="Name Ar"/>

 

 

 

<telerik:GridViewDataColumn DataMemberPath="Full_Name_En" Header="Name En"/>

 

 

 

 

</telerik:RadGridView.Columns>

 

 

 

</telerik:RadGridView>

 



 

Private Sub gvEmployees_DataLoaded(ByVal sender As Object, ByVal e As System.EventArgs) Handles gvEmployees.DataLoaded

 

gvEmployees.Columns(0).Header =

"Test Change"

 

 

End Sub

 

4 Answers, 1 is accepted

Sort by
0
Sameh
Top achievements
Rank 1
answered on 30 Sep 2009, 06:13 AM
two days and no answer, is this a very difficult question.
0
Vlad
Telerik team
answered on 30 Sep 2009, 06:15 AM
Hello,

Can you provide a bit more info about your version? We had similar issue however it is fixed in our latest releases.

Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Sameh
Top achievements
Rank 1
answered on 30 Sep 2009, 07:51 AM
thank you for your reply,
the version is: 2009.2.813.35
0
Pavel Pavlov
Telerik team
answered on 05 Oct 2009, 09:19 AM
Hi Sameh,
I have prepared a small sample project. Please have a look at the file attached (contains both c# and a VB version) . Initially ( at runtime ) it sets the column headers to Spanish , and then when you press a button it switches to English . Please use the Initialize method for any initial settings of the header rather than the DataLoaded event as demonstrated in the sample.

Hope that approach is suitable to your project .


Sincerely yours,
Pavel Pavlov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Sameh
Top achievements
Rank 1
Answers by
Sameh
Top achievements
Rank 1
Vlad
Telerik team
Pavel Pavlov
Telerik team
Share this question
or