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

[Solved] Images in group headers

1 Answer 160 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Shane Woodward
Top achievements
Rank 1
Shane Woodward asked on 28 Feb 2010, 12:32 PM
Hi,
i am using several GridViewImageColumn columns in my grid, the columns show enumeration values as images, the images are sourced using a converter on the binding of the column. The images show up great in the column, no issues there. But when i group by one of those columns, the group header reads System.Windows.Media.Imaging.BitmapImage., which is obviously because of a ToString() done on the image.

Is it possible to show an image instead of text in the group header? When the grouping starts (after i drag the column into the grouping header of the grid), the value converter of the binding gets called the correct number fo times and the correct images are returned. Maybe i am missing a step, maybe there is another template i need to set on the column?

Thanks :)

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 01 Mar 2010, 08:26 AM
Hi Shane,

You can define GroupHeaderTemplate and apply the same converter. Here is an example:

<telerikGrid:RadGridView ItemsSource="{Binding}" AutoGenerateColumns="False">
            <telerikGrid:RadGridView.GroupHeaderTemplate>
                <DataTemplate>
                    <Image Source="{Binding ...}" />
                </DataTemplate>
            </telerikGrid:RadGridView.GroupHeaderTemplate>
...

You may need however to hide/show this image dynamically if you have grouping on other (not image) columns.

Sincerely yours,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Shane Woodward
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or