Select to view content in your preferred language

Disable the Add-In button on selection of one button

3183
6
06-17-2021 04:42 AM
TapasChakrabarty
Emerging Contributor

I have my Add-In on ArcGIS Pro under which I have 4 buttons. So, now I want if I click on any button I want rest of the button get disabled. Until I close the current page.

ArcGIS Pro SDK 2.8 VS2019

0 Kudos
6 Replies
KrisCulin
Frequent Contributor

I think the easiest way to do this is to use the condition.  Set the condition in the config.daml file for your buttons.  Then in the code, you can control the state of the condition.  There are examples of how to do this in the AGP Wiki (a great resource to use as it answers A LOT of questions you might have).

Kris

0 Kudos
TapasChakrabarty
Emerging Contributor

Can you share any links?

 

0 Kudos
KrisCulin
Frequent Contributor

Here is the link to the ArcGIS Pro SDK wiki 

Home · Esri/arcgis-pro-sdk Wiki · GitHub

Kris

0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

This Pro Guide (it's in the Wiki Kris mentioned above) shows how to make your own states & conditions:

ProGuide Code Your Own States and Conditions · Esri/arcgis-pro-sdk Wiki (github.com)

 

by Anonymous User
Not applicable

Hi @TapasChakrabarty ,

On top of states and conditions, you can use this code to enable/disable the button from the ribbon bar.

ProGuide Code Your Own States and Conditions · Esri/arcgis-pro-sdk Wiki · GitHub

FrameworkApplication.GetPlugInWrapper("your button id in daml").Enabled = false;

 

SANTIAGOPARDINIHERNANZ
New Contributor

Hi, thanks for this tip. In my use case,  this FrameworkApplication.GetPlugInWrapper("your button id in daml").Enabled = false; is complaining about being a read only property :(...  Any ideas? 

Thanx in  advance!!

0 Kudos