Sorry if this is a noob questions. I just started learning WPF so hopefully you guys dont mind. But, is it possible to create two columns for each row dynamically through the xaml or would this have to be done in back end code (viewmodel, .cs)? Right now I have just a long list of items through binding with datasource. For example, datasource = "{binding path=House.Item}" ... Item is a collection which stores the label and value as it execute a stored procedure call. eg: label="Color", value="White".
I currently have:
Color <-- label
White < -- value in a textblock
Window <-- label
Vinyl < -- value in a textblock ... etc
I would like to have the result to be 2 column for each row (doesnt display correctly):
Color | >>> Window
White | >>> Vinly
Door | >>> Basement
Wood | >>> Finished
The reason why I would want to achieve this is so I can eliminate the horizontal scrolling just in case the items gets really long. Any advice would be helpful. Thanks a lot in advanced.
Update:
<ListBox.Resources>
<DataTemplate DataType="{x:Type Models:HouseDetail}" >
<Views:HouseView>
</DataTemplate>
<ListBox.Resources>
This is pretty much how my data is generated which again is giving me a flow of like "top to bottom" whereas I would like it to show "left to right". eg: 1 2 3 <-- (what I want) instead of
1
2
3