Represent grid-like data in WPF
I am rewriting a VB6 form in WPF for my companies internal application. The requirement is to display a collection of objects which can have any property edited.
The representation of the data is transposed so that each object is displayed as a column, rather than a row, adding more objects creates more columns:
开发者_如何学Go [Object 1] [Object 2]...
[Property 1]
[Property 2]
[Property 3]
It does not appear that you can swap the rows and columns in the WPF Datagrid without transforming the data - C#/WPF: Toolkit DataGrid - Transpose rows and columns
Is there a way to swap the columns and rows around through a transform, or would I be better doing a data template in a list view?
EDIT: I ended up going with an ItemsControl, using a Horizontal StackPanel as its ItemsPanelTemplate and a Grid as the DataTemplate. Seems to work well, looks exactly like what I was wanting.
Check out listview > grid view.
with datatemplate yes
http://www.c-sharpcorner.com/UploadFile/mahesh/GridViewWpf11082009182813PM/GridViewWpf.aspx
精彩评论