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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (58,843)