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

Styling items in grouping and filtering lists

3 Answers 47 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 04 Dec 2012, 05:10 PM
I have a grid with a DataColumn that has it's CellTemplate set to a DataTemplate that contains a ComboBox.  The ComboBox has it's ItemsSource bound to a Collection in a view model. The collection contains simple integers.

The ComboBox's ItemTemplate contains an Image, with its Source bound to the item, using a Converter that returns a pack URI appropriate to the integer. The result is that cell contains a dropdown of images.

And all of that is working fine.

My problem is that if I group on the column, or apply a filter on the column, the grouping control and the filtering control provide a list of the values of the cells in the column, and the values it displays are the integers, not the images.

Seems to me that if I could get the grouping and filtering controls to apply the converter I am already using in the cell, I'd have what I'd like. But I don't know if that is possible.

Is it?

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 07 Dec 2012, 08:51 AM
Hello,

As to displaying an Image inside the Filtering Control, I would suggest you to check the attached solution in this forum thread. You could use a similar approach in your scenario.

As to your question on the Grouping Control, may I ask you to share what exactly do you mean by that - do you mean the GroupPanel or the GroupHeaderRows?

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Jeff
Top achievements
Rank 1
answered on 07 Dec 2012, 03:36 PM
When I group by a column, the grid displays a tree hierarchy, with one parent row for each distinct value of the column, with the actual rows displayed as children of those parent rows.

In the parent row, the value of each distinct value is displayed, but just like the values displayed in the filtering control, it's the bare value - the conversion is not applied.
0
Dimitrina
Telerik team
answered on 07 Dec 2012, 03:57 PM
Hello,

You could predefine the GroupHeaderTemplate for the GridViewDataColumn as shown on the "Totals" demo available with WPF demos. Then should place an Image to be displayed having the path for it.
 

Greetings,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Jeff
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Jeff
Top achievements
Rank 1
Share this question
or