web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Different gallery layo...
Power Apps
Answered

Different gallery layout based on selection

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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!

Categories:
I have the same question (0)
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    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

  • Verified answer
    BCLS776 Profile Picture
    8,994 Moderator on at

    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

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous 

    Visible property of datatable grid

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard