开发者

Border around a range of cells in a sorted WPF ListBox

I have a horizontal ListBox of items, each of which has two properties: Name, and Parent. Several items have the same Parent, and some items have no parent.

I would like to present the list with items ordered by Parent if they have one, otherwise by Name. That will leave us with a list similar to the following (Parent represented as letter, 开发者_如何学CName as digit):

 1   A1   A2   C1   C2   C3   2   3 

Now I would like to put a border around each group of ListItems belonging to each parent, like so:

    /-A-----\  /-C----------\
1   |A1   A2|  |C1   C2   C3|  2   3   
    \-------/  \------------/

How can I accomplish this?


In theory you might be able to use a CollectionView to group the items and then specify a GroupStyle to draw borders around groups, if the documentation does not provide enough information for you to work with i might be able to help out, but not now.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜