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.
I don't think there is any way to do this. You would probably need to use 3 columns and maybe use RowLayout or a CreationFtiler to combine the column headers into one header.
Hi Mike
Thanks for your input. Since there seems no obvious way to achieve my initial design goal, here's the problem. We have a number of laboratory results that come infrom various places, some internal sources, some external. However, they fall into two categories: plain text (like an emai) formatted results (low limit, actual result, high limit.) We need to display these in chronological order.
So, the plan was to show on one row the formatted numeric results (3 componenets one in each column) and then on another row the first line of text (or maybe subject matter) for a 'plain text' result without formatting (hence the desire to amalgamate 3 columns into 1.) Of course, being in chronological order there is no way of knowing what the sequence might be so the only way to to format the entire row is based on the data itself.
Further, there is no hierarchy, i.e. the owner of each row is the patient.
Any ideas would be gratefully received.
Many thanks in advance
Jerry
Hi Jerry,
I'm still not sure I am clear on exactly what you want. It sounds like each row in your grid needs 4 cells - 3 on one level and 1 on a second level that spans the entire row. This is very easy to do using either RowLayouts or Groups and Levels.
Or am I misunderstanding you?
Mike, thanks again.
I have not made myself clear. There is no linkage between the two types of data except that they are owned by the same patient id - this is because the results come from different sources - sometimes our own internal lab machines which may just produce numbers - hence sets of 3, sometimes from an external lab with potential a page of notes to go with it - hence a single line of plain text. There can be any sequence of result types. e.g:
Hope this makes more sense...
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.
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.
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. :)
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
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.