cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

TemplateHeight and Width not available in a Gallery in a Component

I know it's experimental at this time, but...FYI

 

Referencing the Gallery you are in within the Gallery template does not seem to resolve properly in a Component.

 

Example: Place a Gallery (let's say Gallery1) in a component.  In the template, put a label and set the text to Gallery1.TemplateHeight.  It will be blank.  Create a label outside of the gallery on the component canvas and set the text to Gallery1.TemplateHeight and it will show the proper value.

 

Ran into this while attempting to do the math to center and place items in a gallery in a Component.  

 

Workaround:

I used the label outside of the gallery as a reference point and set visible to false.

Label is Label1.  Text is Gallery1.TemplateHeight.  In the math of the gallery item for Y - I was able to use this formula properly - (Value(Label1.Text)/2)-(lblGalItem.Height/2)

 

Again, trying to do it the way it works outside of components (Gallery1.TemplateHeight/2)-(lblGalItem.Height/2) DOES NOT WORK.

 

Just an FYI for those venturing into Components

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: TemplateHeight and Width not available in a Gallery in a Component

Actually...considering that Galleries seem to be a little temperamental these days - thought I would throw another Gallery in the component and try the same experiment.  That worked!  So, something funky in the first gallery that is an issue.  Nothing about its settings, as there was nothing special done. 

Kind of follows that rule of "if you think something should work and it's not, delete and try again".

I'm going to chalk this one up as an anomaly that is part of the Experimental.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

3 REPLIES 3
Super User
Super User

Re: TemplateHeight and Width not available in a Gallery in a Component

Hey,

 

I tried to replicate what you did but did not have that issue, what features do you have enabled?

Label stayed correct when using as a component on another screen as well.

 

image.png

 

I have on this test app:

 

Delayed Load,

non-blocking start,

improved app rendering,

enhanced savedata,

column display names,

GUID data types,

control Property optimization,

relational data, option sets, other new features,

more reliable concurrent,

 

Components,




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!
Highlighted
Super User
Super User

Re: TemplateHeight and Width not available in a Gallery in a Component

That is strange!!  

Here in this picture is the Component.  Label83 is in the Gallery and the Text is set to the Gallery18.TemplateHeight properly...no result.  Label112 is outside of the Gallery with the same text property and shows the result.

rh.png

 

My settings are:

  • Delayed Load,
  • non-blocking start,
  • Explicit Columns,
  • improved app rendering,
  • Components
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Super User
Super User

Re: TemplateHeight and Width not available in a Gallery in a Component

Actually...considering that Galleries seem to be a little temperamental these days - thought I would throw another Gallery in the component and try the same experiment.  That worked!  So, something funky in the first gallery that is an issue.  Nothing about its settings, as there was nothing special done. 

Kind of follows that rule of "if you think something should work and it's not, delete and try again".

I'm going to chalk this one up as an anomaly that is part of the Experimental.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,480)