Hi
I need two be able to split a column into 3 cells (or put another way merge 3 columns into one cell) but I know I can't do this today with the WinGrid.
So, an alternative would be to use a single column but split the cell by placing 3 text editor controls in the cell side by side.
Of course, each row might be different!
Anyone know how to do this.
Many thanks in advance.
Hi Jerry,
There is a way to set it up so that each row shows either the 3 cells or the one cell and the 1 cell could be set up in such a way as to span accross the same area where the 3 cells are. What you would do is use a RowLayout and set it up such that the 3 cells and the 1 cell occupy the same logical position in the row - overlapping. Then you use InitializeRow to hide certain cells depending on the row data.
It's an interesting technique, but it's probably still easier for you to use the tree. :)
Hi Mike
Yes, every row in the table has all 4 fields and either 1 or 3 have values.
I think you are right though, it sounds like the tree would be better unless hiding the cells means that the space occupied by 3 is the same size as the space occupied by the 1.
Thanks again
Jerry
Just to be clear - it sounds like maybe your data source is actually homogenous. Are you saying that every row in the data source has 4 fields, but that only 1 or 3 of them have values? Or does the data source actually contain a list of objects that are of two different types?
If it's the latter, then the grid won't be able to display the data. But if it's the former, it might be possible using a RowLayout where you have multiple cells occupying the same logical space and you use the InitializeRow event to hide the cells that are irrelevant.
Either way, you would probably be better off with the tree, assuming you don't need to filter or summarize.But I just want to let you know you may have an option.
Mike
You are right, it is not homogeneous data though it does come from a single table - we had to choose between having two tables, one for each data structure, or one table and redundant attributes. We chose the latter because of the complexity of the key structure, no matter. The good thing is we don't need filtering or summaries in this presentation. So, I guess we go and look at using the UltraWinTree instead. Never used it so maybe I'll be back to the forums for that in the future. Right now we fudge it by formatting the data - it isn't pretty - so the UltraWinTree will be a good improvement, it may even play into my hands because some results have more than one component......... I'll get on with it now.
Thanks very much for your input.
How does your data source represent this data? It looks to me like you have a list that contains objects of two different types. This is what we call non-homogenous data and the grid does not support it.
You could use UltraWinTree to display data like this. The WinTree allows you to specify a ColumnSet for each node, so it can handle non-homogenous data sources. The tree lacks certain grid features like filtering and summaries, though.