Tuesday, May 19, 2009

Want to Apply a style to Listview/Combobox Groups? Here is the code:

Hi all,

Have you ever grouped Item in a Combobox? Suppose if I have a list of names, and I want to publish the names grouped with the Initial letters. For example, All names with starting letter as "A" will fall under Group "A" and so on. Like given in the following screenshot :





This is simple. Please download the code from Here

Or check the code which is given below(in images) :

Add the following code to Xaml Window





1 comment:

Ido Ran said...

Hi,
Thanks for the helpful post.
You can simplify things a bit by binding the group header template to Name property of CollectionViewGroup (instead of Items[0].Group) which make the code little clearer.

Thanks,
Ido.