views:

29

answers:

1

Morning folks,

I'm still trying to get my head around databinding in WPF and so I'm having a bit of a problem working out how to solve this issue: I have a datatemplate for a button that I use to display information from a class I have set up, and I've been using a ListView Itemsource to pass in the list of these class objects which is all working fine, but I what I want is to pass in this list of objects to one control and have 3 columns of buttons displayed per row (the order etc doesnt matter, all button are the same except content fields)

Does that make sense?

A: 

Use a UniformGrid:

<UniformGrid Columns="3"> ... your items ... </UniformGrid>
Mart
That sounds absolutely perfect, do I then set the DataContext to my list of objects or is there some other way I need to set the datasource?
Becky Franklin
Just bind your button collection to the UniformGrid.Children.
Mart