Hi everyone,
I'm relatively new to the WinGrid component, and I couldn't seem to find a solution to something I'm trying to do. Suppose I have a datatable with information about the monitor setup for computers. The computers will have a maximum of 2 monitors. The datatable columns are arranged as such:
Manufacturer_Monitor1 Manufacturer_Monitor2 DisplaySize_Monitor1 DisplaySize_Monitor2 RefreshRate_Monitor1 RefreshRate_Monitor2
What I would like to do is create a Ultragrid Cardview that has Monitor1 and Monitor2 as Column headers and the various specs as Row headers. Such as:
I was able to get the row headers to work. I created a group for each row and added the appropriate fields to the group. However I'm stuck on the column header part. Is there any way to do this?
Thanks in advance.
Well, if you are using Groups to create the row headers, then what you could do is create another group with no caption (I think you'd have to use a single space character, actually) and add two unbound columns to it. These two unbound columns would act as column headers. Of course, they would appear as normal cells, by default, but you could use the column's CellAppearance to make the text bold and give them a more header-like appearance by setting the BackColor and ForeColor. Then all you have to do is populate every cell in these unbound columns with the same text.
The InitializeLayout event is a good place to set up the unbound columns. And then I would use InitializeRow to populate the Value of each cell in those columns.