378
Views
3
Comments
Solved
Highlight the button by default
Question

Hai,

I am using two buttonsgroupitems in mobile app.When am go that page want to highlight the 1st button by default..Any one can help me



Thanks,

Jeyasri

2019-09-24 18-41-25
Jorge Martins
 
MVP
Solution

Jeyasri,

Your ButtonGroup has a Variable property, and you will need to assign some variable there.

When the ButtonGroup is rendered, it will try to match the value of the variable you assigned to the Variable property with the value you assigned to the Value property of any of your ButtonGroupItems. If there is a match, that ButtonGroupItem will be highlighted.

in your case, if your textvariable has the value "Issue" then the ButtonGroupItem1 will be rendered highlighted; if it has the value "Suggestion" then the ButtonGroupItem2 will be rendered highlighted; if it has any other value (including "", which is the default value for the Text data type) then none of the ButtonGroupItems will be highlighted.  

2019-09-24 18-41-25
Jorge Martins
 
MVP

Hi Jeyasri,

Make sure the Variable you are using to store what button was selected has a default value that matches the value of the 1st button.

2020-01-03 05-37-58
JEYASRI R

Jorge Martins wrote:

Hi Jeyasri,

Make sure the Variable you are using to store what button was selected has a default value that matches the value of the 1st button.


Hai Jorge,

I assigned the textvariable for button group, buttongroupitem1 value is "Issue" then buttongroupitem2 value is "Suggestion".. like 


2019-09-24 18-41-25
Jorge Martins
 
MVP
Solution

Jeyasri,

Your ButtonGroup has a Variable property, and you will need to assign some variable there.

When the ButtonGroup is rendered, it will try to match the value of the variable you assigned to the Variable property with the value you assigned to the Value property of any of your ButtonGroupItems. If there is a match, that ButtonGroupItem will be highlighted.

in your case, if your textvariable has the value "Issue" then the ButtonGroupItem1 will be rendered highlighted; if it has the value "Suggestion" then the ButtonGroupItem2 will be rendered highlighted; if it has any other value (including "", which is the default value for the Text data type) then none of the ButtonGroupItems will be highlighted.  

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.