I have created a custom control that I would like to convert into an UltraGrid. I was wondering if the UltraGrid supported multiple vertical cells in a single row. I have attached a picture of my control that I wish to convert.
The yellow portion in the attached picture represents the header.
Thanks!
I'm not sure if there is a sample of exactly this. But there are samples in the WinGrid Samples Explorer which use RowLayouts.
A sample isn't much use in a case like this, though, since RowLayouts are much easier to create at design-time, then run-time.
So what you would do is place a grid on a form in Visual Studio. This will bring up the Quick Start. If you have a data source with your data structure already defined, then you just bind the grid to it. Otherwise, you will need to define the structure in the grid manually. Be sure to use the exact same structure your real data source will have including the Key of the band and the keys of all the columns. You don't have to worry about the column data types.
If you already have a grid on a form, then you can use the Start button on the grid to bring up the designer and do the same thing under Basic Settings -> Data Schema.
Exit the Quick Start (if you were in it) and click the Start button on the grid to bring up the grid designer. Go to Band and Column Setings -> Band[0] -> Column Arrangement Overview.
From here you can select RowLayout and then click "Design Column Arrangement Now".
This will take you to the RowLayout Designer so you can drag and drop the columns around however you like. You can simple grab the column header and drop one column above or below another.
You will also want to check out the LabelPosition property on the Column Settings tab. This will allow you to turn off the headers on some of the column, which you will need to do in order to get the look you displayed in your screen shot here.
Also, if you manually defined your schema in the grid at design-time, then you will want to take a look at this article in order to make sure your schema is honored at run-time.
HOWTO:How can I define columns in the grid at Design-time and bind them at run-time so that some fields of the data are excluded from the grid?
Is there an example online where cells are stacked on top of each other like the Hours column is in the posted picture?
Yes, you could do this using a RowLayout.