How to set main header for RadGridView?

7 posts, 1 answers
  1. Eugene
    Eugene avatar
    83 posts
    Member since:
    Jan 2016

    Posted 01 Apr Link to this post

    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.

  2. Stefan X1
    Admin
    Stefan X1 avatar
    523 posts

    Posted 01 Apr Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Eugene
    Eugene avatar
    83 posts
    Member since:
    Jan 2016

    Posted 04 Apr in reply to Stefan X1 Link to this post

    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.
  5. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 04 Apr Link to this post

    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 predefine 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.
  6. Eugene
    Eugene avatar
    83 posts
    Member since:
    Jan 2016

    Posted 06 Apr in reply to Yoan Link to this post

    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.
  7. Answer
    Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 06 Apr Link to this post

    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.xaml 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.
  8. Eugene
    Eugene avatar
    83 posts
    Member since:
    Jan 2016

    Posted 08 Apr in reply to Yoan Link to this post

    Thank you very much for your help, Yoan.
Back to Top
UI for WPF is Visual Studio 2017 Ready