Is it possible to style WPF Toolkit’s DataGrid so a data record can span multiple rows. Example screen shot from a commercial control.
Thanks,
Ben
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is not possible with the toolkit DataGrid or GridView for a ListView, no.
However you may have luck with your own implementation, as I recently discovered you can use
GridViewHeaderRowPresenter(MSDN reference), set theColumnsproperty to the columns you want: that will give you a header row.Then you can use
GridViewRowPresenter(MSDN reference), attach it to the sameColumnscollection and voila, your columns in the rows and header will be linked (resize the header, the columns change).See here for a good example:
In order to get the stacked effect, you could create a
ListVieworListBox, and for each item you’d output a vertically-stacked pair ofGridViewRowPresentercontrols, each bound to a separate columns collection. Then in your own custom header (just above the control) you’d do the same thing with a pair ofGridViewHeaderRowPresentercontrols.You could then add any other bits you’d like as well, for example the text/label that they have in your example screenshot.
No reason why this shouldn’t work. It’s not a pre-built solution but is possible with clean coding, it’s not a hack, and you have complete control over how it looks and works! Adding sorting and so on is fairly easy too, MSDN has an example for that too.
Hope that helps – any more questions on the details of this please add a comment here!