cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Continued Contributor
Continued Contributor

How can I set the Select value of a Gallery to the Nth item?

I want to set a default item from a Gallery as Selected when the screen loads, but not to activate the OnSelect. Is this what the Default Property of a Gallery is for?

How could I make it treat i.e: Row 2 as the Selected row?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

@stapes 

Yes, that's exactly what Default is for.  I believe you could select row 2 by using this code in the Default property.

 

LastN(FirstN(Gallery1.AllItems,2),1)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

2 REPLIES 2
Highlighted
Super User III
Super User III

@stapes 

Yes, that's exactly what Default is for.  I believe you could select row 2 by using this code in the Default property.

 

LastN(FirstN(Gallery1.AllItems,2),1)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Highlighted

To add to that, if you want to make it apparent to the user which gallery item is selected by default, you can set the TemplateFill property of the gallery to:
If(ThisItem.IsSelected, Blue, White)

Blue and White are just for examples. Replace them with the fill colors you want.

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (9,693)