tags:

views:

20

answers:

1

In a WPF application, I am attempting to display the elements from an ObservableCollection in a side-by-side fashion. For example, if the collection was of letters, the basic format would be:

Letters
A    D    G    J
B    E    H    K
C    F    I    L  etc..

I am considering making each a separate ListView and then breaking each ViewModel down into smaller pieces, but creating separate collections (when logically it should only be one) seems like it should be a last resort. Let me know if anyone has any ideas. Thanks.

A: 

You should check out <WrapPanel> here is a decent article on the WrapPanel. A WrapPanel is used to arrange child controls to arrange vertically or horizontally, and will wrap the contents accordingly, based on the size of the items and the size of it's containing parent.

Muad'Dib
Thanks! That is exactly what I was looking for. In case anyone else has the same question and also needs to bind data, I was also able to find this question: http://stackoverflow.com/questions/1575976/binding-observablecollection-items-to-usercontrol-in-wrappanel, which helped me get the data bound correctly. Thanks again for the quick reply!
tltjr
glad to help, that's what we do here!
Muad'Dib