cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
smilingbo
Frequent Visitor

Different gallery layout based on selection

Hello,

 

I'm trying to build an app where the view of a list is shown differently depending whether the 'list' or 'grid' icon is selected. 

 

I understand that I need to build two galleries for the same datasource and that a variable can be set to define which one is used. 

 

I've seen this working as part of the 'inventory' template on Powerapps. 

 

This is the current view of the app I've built:

 

smilingbo_0-1629294582316.png

This is the 'list' view and will be selected by the list icon on the top right (which selects the 'lists' gallery) and the grid will be selected to view the 'grid' layout gallery. 

 

I undertand that I should use collections for this and some variables, but I'm not getting how I display a certain gallery by the icon selected.

 

Any sugguestions would be gratefully received!

1 ACCEPTED SOLUTION

Accepted Solutions
BCLS776
Super User
Super User

It sounds to me as though you should control the Visible property of the two galleries using a single variable, let say one called varListVisible, set to true when you want the list style view to show.

 

In the Visible property of the list style gallery put: varListVisible

In the OnSelect property of the list icon put: Set(varListVisible, true)

In the Visible property of the grid style gallery put: !varListVisible

In the OnSelect property of the grid icon put: Set(varListVisible, false)

 

Hope that helps,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

View solution in original post

3 REPLIES 3
Nogueira1306
Community Champion
Community Champion

Hey! Check this video! The only difference is that I am sorting and you need to filter 🙂

 https://youtu.be/SJqbYa8Tqpk 

 

If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,
Gonçalo Nogueira

BCLS776
Super User
Super User

It sounds to me as though you should control the Visible property of the two galleries using a single variable, let say one called varListVisible, set to true when you want the list style view to show.

 

In the Visible property of the list style gallery put: varListVisible

In the OnSelect property of the list icon put: Set(varListVisible, true)

In the Visible property of the grid style gallery put: !varListVisible

In the OnSelect property of the grid icon put: Set(varListVisible, false)

 

Hope that helps,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

View solution in original post

Drrickryp
Super User
Super User

@smilingbo 

Visible property of datatable grid

Visible property of gallery !grid!1.jpg!2.jpg

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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