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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to change the disp...
Power Apps
Unanswered

How to change the display mode with a button

(0) ShareShare
ReportReport
Posted on by 73

Hi, 

 

Any help to change the display mode of a gallery with a button. I have Gallery4 (which is currently in display mode: view) and have added a pen outside the gallery with the following code but It has not worked: 

If(Gallery4.DisplayMode=View,UpdateContext({dmv: DisplayMode.Edit}),UpdateContext({dmv: DisplayMode.View}))

 

Thank you

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    Hi @bolandre92 ,

    Galleries by default are DisplayMode.Edit, but you cannot really edit anything (and expect it to be saved) in a standard gallery. There is a process that can allow editable controls to be put in a gallery and using Patch update the source data list. You can also set the DisplayMode of individual controls in the gallery.

    What are you trying to achieve (and what are you expecting to see different) with the DIsplayMode change.

     

    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.

  • bolandre92 Profile Picture
    73 on at

    See image attached. 

     

    The data in the center of the screen is in View mode. I want to  turn it into Edit mode with the pen button so that users can update it in case of being required and there after run a Patch with the disk button next to the pen.

     

    Let me know if you need more information and thank you for your kind help

     

     

  • bolandre92 Profile Picture
    73 on at

    Hi @WarrenBelz 

     

    Were you able to get an outcome out of my screen picture? 

     

    Thank you

  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    Hi @bolandre92 ,

    As I said, you cannot edit gallery items by simply changing the Mode (which is Edit by Default anyway to allow an item to be selected and displayed in a form).

    The objects in a gallery by default are labels. You can, as I mentioned, set up a gallery to accept controls that will allow their values to be Patched back to a list. This video from Shane Young @Shanescows explains it fairly well, but simply changing the mode will not do the job you are expecting.

     

    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.

  • Verified answer
    v-siky-msft Profile Picture
    on at

    Hi @bolandre92 ,

     

    I made a test on my side based on your code, but don't have any issue you mentioned.

    Please ensure the DisplayMode property of all Text Input boxes in Gallery is Parent.DisplayMode and Set Gallery.DisplayMode to dmv.

    Snipaste_2020-04-20_16-20-07.pngSnipaste_2020-04-20_16-20-19.png

    Hope this helps.

    Sik

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard