views:

413

answers:

1

It's easy to repeat templated data, using List box, or StackPanel + ItemsControl, etc. However, I cant figure how to get multiple columns, ie, column alignment.

Example:

Name: John Doe

Street: 123 st

City: Seattle

State: WA

This link below shows the general layout I am trying to programmatically replicate (scroll near bottom): http://karlshifflett.wordpress.com/2008/10/23/wpf-silverlight-lob-form-layout-searching-for-a-better-solution/

Obviously, the data (and label) can vary in size. Also obvious, I could force a fixed width repeating a horizontal stackpanel, but that is lame.

In ASP.NET, you just use a repeater, and get results by repeating a table row + columns. Since an HTML table respects/adjusts the column sizes for ALL rows, the data will simply line up. In silverlight, you... do what?

Note: a datagrid could do this... by why on earth would you want to use that for simple layout of a "form" like this example?

A: 

Is the entire pattern above repeating, meaning you have this block of options for each item? If so, why not just make your ItemTemplate a Grid with the left column fixed width? If not, can you elaborate more?

Joel Cochran
Yes, the entire thing repeats, but not with the same type of data. My form looks like this (scroll near bottom):http://karlshifflett.wordpress.com/2008/10/23/wpf-silverlight-lob-form-layout-searching-for-a-better-solution/It is built on the fly, i.e., it might have these 4 groups of fields, or it might have 3 or 13. Each group has its own template and type of data. And in my case, even within a group like "address", I might have 3 lines for street, or not. And it would render according to the collection of fields that comes in.
David