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 / Setting DisplayMode of...
Power Apps
Answered

Setting DisplayMode of a button from another button

(0) ShareShare
ReportReport
Posted on by 58

Hi,

I have a button that has an onSelect function of

 

If(butStartPA.DisplayMode = DisplayMode.Disabled, butStartPA.DisplayMode=DisplayMode.Edit,butStartPA.DisplayMode.Disabled)

 

butStartPA being another button.

 

I put this in test mode, click on the > run option and it doesnt do anything.  I've read you can get a button to set its own DisplayMode dependant on another control, but want to do this by clicking on a button.  Is this possible?

Image 001.png

 

Categories:
I have the same question (0)
  • CU-18081211-6 Profile Picture
    9,270 Moderator on at

    @JohnJDB ,

    Use a local variable to control the display mode status of the Start PA button control. 

    Set the Start PA display mode property to: 

    StartPAButtonMode (just an example)

    And set On Select property of the Access button to:\

    If(StartPAButtonMode=DisplayMode.Disabled,
     UpdateContext({StartPAButtonMode:DisplayMode.Edit}),
     UpdateContext({StartPAButtonMode:DisplayMode.Disabled})
    )

     Hope it helps !

  • JohnJDB Profile Picture
    58 on at

    Thanks for the alternative pattern @gabibalaban .

     

    So is it not possible to set the properties of a control directly from another control then?

  • Verified answer
    CU-18081211-6 Profile Picture
    9,270 Moderator on at

    Yes, that's right. You cannot set a control property using directly reference.   

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard