Using Version 12.2... I have an UltraGrid with one band, set with RowLayoutStyle set to ColumnLayout. I have five columns in the band layed out like this:
█████████████████████████████████ Country █ STATUS █ INFORMATION ██ ████████████████████████ █ COMMENTS ██ ████████████████████████ █ DEPLOYMENT █████████████████████████████████
COUNTRY... origin x = 0, origin y = 0, span X = 1, span Y = 3STATUS... origin x = 1, origin y = 0, span X = 1, span Y = 1INFORMATION... origin x = 2, origin y = 0, span X = 1, span Y = 1COMMENTS... origin x = 1, origin y = 1, span X = 2, span Y = 1DEPLOYMENT... origin x = 1, origin y = 2, span X = 2, span Y = 1
The DEPLOYMENT value is optional for records displayed in this grid. What I would like to do is set the HIDDEN property for the DEPLOYMENT cell in each row TRUE or FALSE dependent on whether it needs to show or not. This I easily know how to do. However, if the cell is hidden, I would like the COUNTRY cell to only SPAN Y = 2. That's what I have no idea how to accomplish. If I hide the DEPLOYMENT cell without changing the Y span of COUNTRY, the spot for the DEPLOYMENT cell is still allocated, even if the cell isn't actually visible.
Can I even do this?
Just bumping this post since there's been no replies. Would definitely like to know if anyone has a clue whether what I'm trying to do is possible.
Thanks!
Hi Steve,
First off, I just want to apologize that your post did not receive a response. I think what happened is that the blocks you included to show the layout of your row triggered some kind of filter and your post was flagged as potential spam so it got lost in the shuffle.
In any case, there's no way to vary the SpanY or an item on a per-row basis. So there's no simple way to achieve what you want here.
I think there is a way, but it's a bit convoluted. What you could do is create a second, unbound column that duplicates the Country column. So basically, you would add an unbound column to the grid and call it "Country 2" or something like that. You would set it's header.Caption to "Country" and then use the InitializeRow event to copy the real Country column's value into Country 2, so you essentially have 2 copies of that column to present to the user.
You would then set the "Country 2" column's RowLayoutColumnInfo to the same settings as the Country column, except, you would change the SpanY to be 1 less.
Then when you make the Deployment cell visible or hidden, you would also hide either the "Country" or the "Country 2" for that row so that only one is visible.
No worries... from past experience I know you all are usually pretty good at replying to forum posts. That's why I bumped this because I figured something was amiss... :-)
I will give your idea a shot over the next couple of days and let you know how it works out. Thanks for the advice!
Steve
Okay. Let me know if you need any further guidance on the technique I described.
Unfortunately this didn't work as expected. I attached a scan of my resulting grid, but this comes from a closed network so I had to print an image of the grid and scan it so I could attach it here. Hopefully you can see enough for me to explain what's going on.
The ALLEGIANCES column is basically the COUNTRY and COUNTRY2 columns. When an allegiance cell is green that's COUNTRY2 visible; when it's yellow that's COUNTRY visible. The long blue cells are the DEPLOYMENT column.
As you can see for the first row (allegiance = ALB) the DEPLOYMENT cell is hidden, the COUNTRY2 cell is visible (green) and the COUNTRY cell (yellow) is hidden. That's what we're going for, but what the grid is doing is reserving the space of the hidden cells. You can see those areas as gray with the red lines drawn in them. The second row (allegiance = ATA) shows when the DEPLOYMENT cell is visible - COUNTRY is visible and COUNTRY2 is hidden. Row 3 (allegiance = AUS, BHS) is similar to row 1 where DEPLOYMENT is hidden, COUNTRY is hidden and COUNTRY2 is visible, with the placeholders still showing.
Any thoughts on this?