In the ultrawingrid is it possible to have 2 seperate cells under 1 column heading?
The 2 cells are related so I want the user to know this and enter both values in.
There are a couple of ways you can do this.
Using Groups, you can group related columns together. You do this by adding Groups to the Band, then assigning each column to a group. If you have groups, then every column must be in a group in order to be visible.
The other way to do it would be to use RowLayouts.You would set the LabelPosition on the two columns in question to None. Then create a dummy unbound column whose LabelPosition is LabelOnly and arrange it so it spans the two columns.
I have tried the group column approach. although it does work it doesn't have the flexibility of moving the columns between groups.
I tried setting the rowlayouts labelposition property on the 3 columns but nothing seems to happen. The new dummy column was set to labelonly but when I resize it the column beside it shifts over as it would normally instead of overlapping the column label beside it.
the other columns have had the labelposition property set to none.
Any ideas?
allyli said:I have tried the group column approach. although it does work it doesn't have the flexibility of moving the columns between groups.
I'm not sure what you mean by this. You want to allow the user to move columns between groups? That doesn't seem to make sense, but I'm pretty sure you can do this by using AllowColMoving.
allyli said:I tried setting the rowlayouts labelposition property on the 3 columns but nothing seems to happen. The new dummy column was set to labelonly but when I resize it the column beside it shifts over as it would normally instead of overlapping the column label beside it. the other columns have had the labelposition property set to none.
I'm not sure I understand this, either. What do you mean that "nothing seems to happen?" You are setting the LabelPositon and it has no effect? Did you set the Band.UseRowLayouts to true?
When you drag the column header over, you need to change the Span, not the width. If you do this in the grid designer, there are glyphs on the edges of the headers and cells that allow you to drag the span, rather than the width. Or you could just set the SpanX property so that the column spans across two other columns.
Hi Keerti,
If you are using RowLayouts, then you can hide a column header using the LabelPosition property. You would have to set this on the LayoutInfo of each column.
If you are not using RowLayouts, then you can just use the ColHeaderVisible property on the Override object.
Hi
I am able to group the columns under a group but i dont want individual column headers to appear. Its enough if the group Header appears , is there any way to remove those column headers under a group or set visible = 0. Would be great if you can provide some help on this
Thanks & Regards
Keerti Somasundaram
That worked a treat! Thanks.
Yes, it is possible to move columns programmatically. You would do this by changing the LayoutInfo properties on the column. It's a little more complicated than you may be used to, though. You really need to understand GridBagLayouts and how they work. You probably want to change the OriginX and OriginY in this case.
Ok I've managed to get it working somewhat.
Is it possible to move columns programmatically as when I move the dummy column to a different location in the wingrid it leaves behind the 2 columns under it.