Display ListBox by 2 branches in WPF
I have a listbox to display a datasource. The datasource has only one field ("ClassName"). I want the listbox is displayed by 2 branches.
Example:
Class开发者_JAVA百科Name:
ClassName1
ClassName2 ClassName3 ClassName4Display: =>
ClassName1 ClassName2
ClassName3 ClassName4Just tell me how to do that please! thanks!
You'd have to change the Listbox's ItemsPanel to something that supports the display that you want. The WrapPanel would probably work well, but you'd have to use a custom listboxitem style to ensure the width is the same for all items. You could also use a Grid with 2 columns. You'd have to specify the Column each item is in however, which might be tricky.
精彩评论