Using Winforms .NET 2.0, my client has requested that data in a Datagrid be displayed vertically rather than horizontally. The data layer of the app is built upon NHibernate, so I generally avoid writing raw SQL in favor of HQL. However, this scenario may lend itself to utilizing the 'crosstab' functionality of SQL Server 2005.
So for example, the current gridview layout (which mirrors the table design) is bound to an IList(of ClaimGroup) as such:
GroupName | ClaimType | PlanCode | AgeFrom | AgeTo | AgeSpan
BHFTConv 1| P | CC | 6 | 12 | Years
needs to become:
GroupName | BHFTConv 1
ClaimType | P
PlanCode | CC
AgeFrom | 6
AgeTo | 12
AgeSpan | Years
The grid currently has, and will still require, an 'Apply' button that will save any changes made to the rotated grid.
So what would you do? Use raw SQL to crosstab the data, thereby breaking the NHibernate law of avoiding db specific queries? Or is there some mechanism built into a DataSet that would allow the data to be rotated? Or just use brute force to rotate the data?
thanks in advance