如何显示Silverlight组合框中项目的组头?

编程入门 行业动态 更新时间:2024-10-28 10:25:07
本文介绍了如何显示Silverlight组合框中项目的组头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在Silverlight中有一个组合框,其itemssource与 CollectionView 的 CollectionViewSource 绑定。

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

我还向 CollectionView 添加了 GroupDescription 。

现在我需要显示 ComboBox 中的项目,并且还需要显示组头。

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

在WPF中有 ComboBox.GroupStyle ,我可以在其中定义组头。

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

感谢

推荐答案

Silverlight组合框不支持分组。只需在绑定组合框之前对项进行排序,然后在组合框itemtemplate中显示组名和项名称就足够了?组合框项目将如下所示:

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:

类别:啤酒,名称:锚点Steam 类别:啤酒,名称:百威 类别:葡萄酒,名称:作品1 类别:葡萄酒,名称:Sassicaia

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

更多推荐

如何显示Silverlight组合框中项目的组头?

本文发布于:2023-11-05 15:31:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1561221.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:组头   组合   框中   项目   Silverlight

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!