开发者

How to show group header for items in Silverlight combobox?

开发者 https://www.devze.com 2022-12-16 03:40 出处:网络
I have a combobox in Silverlight, whose itemssource is bound with a CollectionView of CollectionViewSource.

I have a combobox in Silverlight, whose itemssource is bound with a CollectionView of CollectionViewSource.

I have also added Gro开发者_运维百科upDescription to the CollectionView.

Now I need to display the items in ComboBox grouped and also need to display the group header.

In WPF, there is ComboBox.GroupStyle where I can define the group header. Whats the way to do it in Silverlight?

Thanks


The Silverlight combobox does not support grouping. Would it be sufficient to just sort the items before binding the combobox and then displaying both the group name and the item name in the combobox itemtemplate? The combobox items would then look something like this:

Category:Beer, Name: Anchor Steam
Category:Beer, Name: Budweiser
Category:Wine, Name: Opus 1
Category:Wine, Name: Sassicaia

0

精彩评论

暂无评论...
验证码 换一张
取 消