This question may have been asked/answered numerous times, but I can't think of sufficiently distinct terminology for a meaningful search.
Can the Infragistics DataGrid for WPF (xamDataGrid) handle transposing rows for columns? We need a grid that will represent the collection of objects (records) as columns and the properties of each object (record) as rows. I'm managing this today with the free grid included from Microsoft, but it requires a fair bit of coding on my part. We're trying to follow the MVVM pattern, so it would be much nicer if we could simply bind our collection this way. One of the problems this causes is that the columns are non-homogeneous. I may want a string in one row, and an int in the next.
Here's a (somewhat lame) example to demonstrate what we're after:
In the example, I have an "Employee" record with three properties ("Name", "Birthday", "Shoe Size") of different types. The collection of employees form the columns. I'd need a textbox for editing the names, a date-picker for editing the birthday, and something like xamInputs for editing the shoe size. Is this possible with the Infragistics grid? Is it relatively easy, or does it require a lot of custom code?
Alternatively, is there a different control I should be using for this?
Thanks!
Brad.
Hello Brad,
Thank you for your post. I have been looking into it and I can suggest you set the XamDataGrid’s ViewSettings’ Orientation Property to Horizontal. This way the grid will look like you want. Also I can say that it uses XamDateTimeEditor for DateTime values, XamNumericEditr for double and integer values and XamTextEditor for the string values by default. I also attached a sample project for your reference. Please let me know if this helps you or you have further questions on this matter.
Looking forward for your reply.
Yes, it looks like that's exactly what I'm looking for. I'll have to do a bit more work with it to confirm, but it sure looks promising!
I think all's well for now. I may have more questions if/when we get further into it, but now I'm just waiting for the purchasing process to complete (and to get a bit more time to devote to this). :-)
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
Thank you for your feedback. I will look forward to hear from you.