cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

Dynamic Y based on selection in a gallery?

Hi,

I have two galleries. Gallery 1 contains a list of 5 items. Gallery 2 contains the details of each item from Gallery 1.

I would like to position the location of Gallery 2 right next to the selected item from Gallery 1 (i.e. dynamic Y based on the selected item from Gallery 1).

Doable?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: Dynamic Y based on selection in a gallery?

Hi @karimabdelrazek ,

I have just tested it and this works (except as I mentioned, it can go off the screen if your numbers are big enough)

Gallery1.Selected.RowNo * Gallery1.TemplateHeight + Gallery1.Y

 

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.

View solution in original post

5 REPLIES 5
Highlighted
Community Champion
Community Champion

Re: Dynamic Y based on selection in a gallery?

Hi @karimabdelrazek ,

Firstly, the Selected Item of a gallery does not have a Y Property.

Depending on the possibility if this going off the screen, it would be (sort of) achievable by collecting the first list

ClearCollect(colFirstList, FirstList)

Adding a number column to it

Clear(colYRef);
ForAll(
   colFirstList,
   Collect(
      colYRef,
      Last(
         FirstN(
            AddColumns(
               colFirstList,
               "RowNo",
               CountRows(colYRef) + 1
            ),
            CountRows(colYRef) + 1
         )
      )
   )
)

Then setting base the First list on colY and the Y of the second list to something like

(colY.Selected.RowNo * Gallery2.TempleSize) + Gallery2.Y

I have not tested any of this - it is a concept.

 

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.

Highlighted
Helper III
Helper III

Re: Dynamic Y based on selection in a gallery?

@WarrenBelz . Thank you for the concept! I'll try it out and let you know if I got it to work or not.

Highlighted
Community Champion
Community Champion

Re: Dynamic Y based on selection in a gallery?

Hi @karimabdelrazek ,

I have just tested it and this works (except as I mentioned, it can go off the screen if your numbers are big enough)

Gallery1.Selected.RowNo * Gallery1.TemplateHeight + Gallery1.Y

 

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.

View solution in original post

Highlighted
Helper III
Helper III

Re: Dynamic Y based on selection in a gallery?

Thanks so much Warren! You beat me to it! 🙂
Highlighted
Community Champion
Community Champion

Re: Dynamic Y based on selection in a gallery?

Hi @karimabdelrazek ,

A bit of fine-tuning - I am actually going to use this myself. This will line the second gallery up exactly with the top of the selected item on the first on every selected item.

Gallery1.Selected.RowNo * 
(Gallery1.TemplateHeight + Gallery1.TemplatePadding) + 
Gallery1.Y - Gallery1.TemplateHeight

 

FloatingGallery.gif

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,122)