Skip to main content
14-Alexandrite
October 25, 2023
Solved

Binding 'ButtonType' property.

  • October 25, 2023
  • 1 reply
  • 1260 views

I am trying to bind the 'ButtonType' property of a button with an expression. The expression is auto evaluated when a property value changes.

The output of the expression is a string with output value as 'Secondary' or 'Danger' depending on the scenario. But the button type does not seems work, it is always in black color instead of changing the color based on expression output.

 

Best answer by VladimirRosu_116627

The ButtonType values are not the ones you used, instead they are "primary", "secondary" etc.

In the beginning, bind a label as the output for the ButtonType to see the values it has depending on how you set it, then use those in the expression.

1 reply

19-Tanzanite
October 25, 2023

The ButtonType values are not the ones you used, instead they are "primary", "secondary" etc.

In the beginning, bind a label as the output for the ButtonType to see the values it has depending on how you set it, then use those in the expression.

14-Alexandrite
October 25, 2023

Thanks alot, it is working. I just checked the options available in ButtonType and tried to use it, but didnt know that i have to use the text in lower case. 

Is it the same case for all the properties? we have to use the options in lower case or is there any place where we can check the which case to use.

19-Tanzanite
October 25, 2023

Hi,

For all the properties that are in a dropdown (since they are the only one where this applies) you should always verify all their values via the Label approach.

The available values for dropdown lists are not documented in the Help Center - probably a good thing to do in the future - and as far as I know they are not guaranteed by design to be the lowercase versions of what you see, even if most probably they are.