Nico
Nico

Reputation: 575

ListBox GroupStyle HeaderTemplate with a color

I would like to create a HeaderTemplate for GroupStyle (ListBox) which contains a rectangle with a color and the name of a color.

I have a list of employees. Each employee has a color. I used a ListBox and a CollectionViewSource with a specific converter to group employees by their own color. It works great! But at the time, I can only bind the property Name of each group in my HeaderTemplate.

Is there a way to perform this ?

Upvotes: 1

Views: 858

Answers (1)

brunnerh
brunnerh

Reputation: 184441

The Name of the group will be the color, if you bind it to the Color property of a SolidColorBrush it should be converted automatically.

Upvotes: 1

Related Questions