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

Custom group header text

1 Answer 549 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Мирзодалер
Top achievements
Rank 1
Мирзодалер asked on 09 Jul 2016, 09:14 AM

Hi,

I want to change the default header text. For example I have following properties

  • Id
  • Title
  • Description

If user will group it by Id, then I want to show group header text like [Id]:[Title]. How can I do this?

 

Thanks, 

Daler

 

 

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 12 Jul 2016, 12:44 PM
Hello Mirzodaler,

Please have a look at the following forum threads where similar scenarios have been discussed:
Group Header - row data in group header
Setting DisplayContent property
Group header with converter

To sum them up, you should specify a custom template as the GroupHeaderTemplate of your RadGridView instance and modify that to your liking. Here's an example:

<DataTemplate x:Key="GroupHeaderTemplate">
    <StackPanel Orientation="Horizontal">
        <TextBlock Text="{Binding Group.Key}" />
    </StackPanel>
</DataTemplate>

Bear in mind that the data context of this template is of type GroupViewModel.

I hope you find this information helpful.

Regards,
Dilyan Traykov
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
GridView
Asked by
Мирзодалер
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or