Hi,
Having trouble getting a nested gallery to read properties of its controls within. Anyone know if this is a bug/by design/user error?
To expand, I have a gallery (Main_Gallery) with a gallery (Sub_Gallery) inside it.
I'm trying to get the Sub Gallery to dynamically wrap depending on the width of the text labels (eg SG_TextLbl) within, but the Gallery is unable to read the width/height/text properties of those items. Even if I simply put
Sub_Gallery.Height = SG_TextLbl.Height
The formula results preview then displays "SG_TextLbl.Height = | Data Type: Number" and the gallery has 0 height.
Even tried setting the .Text value of SG_TextLbl to it's own height, Gallery couldn't read that either.
Hi @Slaverty ,
May be a silly question, but are you using a standard gallery or a Flexible Height item?
If the standard item, here is a video on creating Flexible Height items.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
I thought the "Flexible" in "Flexible Height Gallery" relates only to flexible template sizes, rather than the size of the whole gallery?
In any case, I created 2 new flexible height galleries containing just a single Label each, one gallery nested within the other. The results lead me to believe this is a bug. Initially, the parent gallery could read the label's width, but not the height, both were defined absolutely (70 and 50 respectively).
I then tried replacing the labels width and height with formulas, after which the gallery couldn't read either.
I then put the label's width and height back to defined values (70 and 50 respectively), but the parent Gallery was still unable to read either.
I then checked some other properties, seeing what the gallery could read, and it read the Padding, LineHeight, Size, BorderThickness properties fine, so I switched back to Width and now that worked again, but height still isn't.
EDIT
After a little more playing around, discovered something even weirder.
If Label.Height = 70,
And Label.Width = Label.Height,
And Gallery.Height = Label.Width
Gallery.Height becomes 0, formula preview indicated "Label.Width = | Data Type: Number"
but
If Label.Width = 70,
And Label.Height = Label.Width,
And Gallery.Height = Label.Height
Gallery.Height now = 70.
So definitely something weird going on with the parent gallery reading the child's height property
Hi @Slaverty ,
Yes you are right about the template in these galleries.
I am not sure if this helps, but I can share some experience I have had on “cascading” dependencies of control values, mine were about colour attributes, but the principle is the same.
Once I got beyond three levels and did a variable-driven change, it did not always reach the “end of the line”. You are taking about a different component of course, but it has more work, moving things around the screen.
I recently watched a couple of good videos on your subject from Paul O’Flaherty
You might find a solution in these.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
User | Count |
---|---|
253 | |
106 | |
94 | |
50 | |
39 |