Custom GroupHeaderTemplate with GridViewComboBoxColumn and ItemTemplate

2 posts, 0 answers
  1. Jason Maronge
    Jason Maronge avatar
    321 posts
    Member since:
    Jan 2005

    Posted 05 Oct 2011 Link to this post

    Can anyone tell me how to get the GroupHeaderTemplate to work in my situation. I have the following column in my grid that is a GridViewComboBoxColumn with a ItemTemplate.  The ItemTemplate lets me use the "Lastname, Firstname" to display to the user.  I want that to also be the text in the Group headers.  Can this be done? 


    <telerik:GridViewComboBoxColumn MinWidth="80"  
                                    DataMemberBinding="{Binding ClientId}"
                                    Header="Dependent of"
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding Lastname}" />
                    <TextBlock Text=", " />
                    <TextBlock Text="{Binding Firstname}" />
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding ???????.Lastname}" />
                    <TextBlock Text=", " />
                    <TextBlock Text="{Binding ???????.Firstname}" />

    I have the following GroupDescriptor setup:

        <telerik:GroupDescriptor Member="ClientId" SortDirection="Ascending" DisplayContent="Dependent Of"   />
  2. Maya
    Maya avatar
    4062 posts

    Posted 06 Oct 2011 Link to this post

    Hello Jason Maronge,

    The DataContext of the group row (and the StackPanel consequently) is GroupViewModel. It contains properties like Group, Column, AggregateResults, etc. What you could try is to bind the TextBlock-s in the GroupHeaderTemplate and based on the values of the properties in the GroupViewModel to return those you want through an IValueConverter for example.

    Best wishes,
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top