Using the UltraWinGrid how do I merge columns. For example if I have four columns in my grid and I want to merge columns 2 and 3 how would I do this? I cannot seem to find a clear answer on the forums or documentation.
Thank you,
Glenn
Hello,
UltraWinGrid doesn’t support build-in functionality for merging cells across columns. I am not exactly sure what you mean with “how do I merge columns”. If you want to merge some cells, across columns you could use Creation Filter in order to cover the editor of the second column with editor of the first column. I have implemented a very base sample in order to demonstrate this approach. Please run the sample and let me know if this is what you are looking for.
Please let me know if you have any further questions.
Hi Hristo,
Let me clarify further. Within a row I am trying to merge cells. So let's say my table has four columns in it. For a particular row I might need to merge the cells in columns 1 and 2. In another row I might need to merge cells from all four columns.
So for instance I have this:
Col1 Col2 Col3 Col4
Text1 Text2 Text3 Text4
Text1 Text2 (Cells merged for row in col1 and 2 and col3 and 4)
Text1 (Cells merged for row in all four columns)
I need to be able to merge cells in a row like this. I will review your example, but perhaps there is an easier implementation.
OK, the logic you sent me works, but once the grid is rendered and the cells are merged how can I stop the grid from calling the logic you sent me. The issue is I added my own custom logic for certain rows so that the cells can merge, but once the grid is rendered the logic is still invoked and it messes up the merging.
Hi,
Can you please tell me how to merge the adjacent selected cells in ultragrid.
The cells should be of different values.
Please help me to solve this problem.
Thank You,
Arshad Naik
Hi Arshad,
There's no built-in functionality in the grid to merge cells in the same row.
The MergeCellStyle property on the column allows you to merge cells within the same column that have the same values.
Why would you want to merge cells that have different values? I'm not sure what that would mean or what it would look like.
Hi Mike,
The exact situation in my project is, there is a Ultragrid with blank cells and I have to merge the selected adjacent cells.
The selected cells may be from same or different columns.
Please help me to find the solution.
Thanks and Regards,
Arshad Naik.
Well... assuming you are not allowing editing, you might be able to achieve what you want using a CreationFilter.
Or, if editing is required, then it might be possible using a RowLayout with overlapping cells.
But there's really not enough information here for me to advise you. What are the requirements? What are you trying to acheive? Can you explain in more detail? Or maybe provide screen shots?
Hi Sandeep,
The grid can merge cells with the same values across rows, but it cannot do it across columns - at least not without using a messy CreationFilter.
It doesn't sound like you need cell merging. Do you really need to have different merging of cells in each row of data? And why would you need to merge across rows in the same column if you are showing an image? If you just want to display an image in a row and you want that image to span multiple columns or levels within that row, then you could just use a RowLayout.
Maybe I'm wrong. It might help if you could post a screen shot of what you are trying to do.
The ultrawingrid I am using has an image (such as kidney/prostate etc...) as background and we are using this for annotation purpose in a electronic health record application. My request is I want to merge multiple cells in same column and multiple cells in same row of ultrawingrid. This is similar to excel cell merge/unmerge functionality.
The merged cells needs to be used for identification and annotation for specific diagnosis.
Thanks
Sandeep Shyam
I am waiting for your reply.
Regards
Nitin Gupta
for explanation of requirment.
thanks
Dear please find the attached file.
Hello Nitin,
What you meant by “when i check any two headers then corresponding Cell of these two columns should be merge”. What is expected to happen when you check Name and Age columns ? Which exactly cells and how they must be merged ?
I am waiting for your feedback.