cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
karimabdelrazek
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

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
WarrenBelz
Super User III
Super User III

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.

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

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

Thanks so much Warren! You beat me to it! 🙂

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,945)