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

How to set main header for RadGridView?

6 Answers 561 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Eugene
Top achievements
Rank 1
Eugene asked on 01 Apr 2016, 07:40 AM

Hi! I try to use RadGridView in my WPF MVVM project. I use it at first time and face with a little problem. This problem is that I want to set main header for  RadGridView but I don't know how to do it. The picture with my RadGridView is in radGridView.PNG attached file. Below is XAML in the View where I define RadGridView:

<telerik:RadGridView Grid.Row="1" Grid.Column="0" HorizontalAlignment="Center"  Margin="8,5,0,0" VerticalAlignment="Top" AutoGenerateColumns="False"
                             ItemsSource="{Binding Path=DeviceRecords}">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding DeviceName}" Header="Name"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding SerialNumber}" Header="Serial Number"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding NamePlaceDeviceInstallation}" Header="Location"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding CompanyOwnerOfDevice}" Header="Owner"/>
            </telerik:RadGridView.Columns>

</telerik:RadGridView>

As you can see from attached file, now "Drag column header and drop it here to group by that column" string on the top of RadGreedViewid is displayed. But I want that, for example, "Existing Device Specifications" string as main header of RadGridView is displayed on the top of RadGreedView instead of "Drag column header and drop it here to group by that column" string. How to do that? Please help.

6 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 01 Apr 2016, 01:21 PM
Hello,

Can you please take a look at the Localization article? You will need to modify the value for the "GridViewGroupPanelText" resource key.

Let me know if you need any further assistance.


Regards,
Stefan X1
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Eugene
Top achievements
Rank 1
answered on 04 Apr 2016, 05:48 AM
Hello, Stefan. Thank you for your support. But now I'm not need in locality language setting. Now I'm simply need in RadGreedView main caption (header). So I spesify my question more accurately: "How to display RadGridView title (caption) on the top of RadGreedView control?" For example: ("My Nice Greed View", "Devices Information from Database", e.t.c) instead of "Drag column header and drop it here to group by that column" string.
0
Yoan
Telerik team
answered on 04 Apr 2016, 10:19 AM
Hi,

Using the localization approach you can easily change the text - "Drag column header and drop it here to group by that column" with your custom one. You need to change only the GridViewGroupPanelText resource key. This is not real localization of your application, this is only a simple way for changing the needed text. However, the other approach would be to the template of RadGridView and change this text directly in the template.

Regards,
Yoan
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Eugene
Top achievements
Rank 1
answered on 06 Apr 2016, 05:03 AM
Hi! You wrote: "...the other approach would be to predefine the template of RadGridView and change this text directly in the template". Could you give me an example of this approach (if this is posible ofcourse)? To see how to do it is very interesting. I would be very thankful to you for it.
0
Accepted
Yoan
Telerik team
answered on 06 Apr 2016, 02:32 PM
Hello,

Yes, it is possible. I have created a sample project for you using our Implicit Themes approach. You can check the changes I made of RadGridView's template in Themes/Telerik.Windows.Controls.GridView. file (line 3692).

Regards,
Yoan
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Eugene
Top achievements
Rank 1
answered on 08 Apr 2016, 09:45 AM
Thank you very much for your help, Yoan.
Tags
GridView
Asked by
Eugene
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Eugene
Top achievements
Rank 1
Yoan
Telerik team
Share this question
or