Data Standard Use RadioButton

Data Standard Use RadioButton

fsanchou
Advocate Advocate
532 Views
2 Replies
Message 1 of 3

Data Standard Use RadioButton

fsanchou
Advocate
Advocate

Hello,

 

I have create  2 RadioButton (Yes/No).

<RadioButton x:Name="RB_YES" Content="Yes" GroupName="GROUP_RB" />

<RadioButton x:Name="RB_NO" Content="No" GroupName="GROUP_RB" />

 

How can I "link" this RadioButton with an Inventor's iProperty and write "Yes" or "No" in this iProperty?

 

Thanks

 

 

 

 

 

0 Likes
Accepted solutions (1)
533 Views
2 Replies
Replies (2)
Message 2 of 3

marco.mirandola
Advocate
Advocate
Accepted solution
Hi, this is not trivial unfortunately. RadioButtons uses the IsChecked property in order to signalise which option has been set. Now, if you bind all the RadioButtons to the same property, you'll end up having either all buttons checked or unchecked. This means you have to bind the IsChecked to different properties. Then you can subscribe the OnPropertyChanged Event of each property and depending on which property is set you can finally fill up the property you want. This is messy!

Frankly i never used radio buttons, because if it's a pure yes/no then i use a CheckBox and bind the IsChecked to my property.
If i have several options, then i prefer a combobox. It's smaller and at the end you pick just one of the options anyway.
RadioButton are interesting only for multiple choice, but even there a combobox with checkboxes might be an alternative.

i hope this helps

ciao
marco

coolOrange
www.coolorange.com
0 Likes
Message 3 of 3

fsanchou
Advocate
Advocate

Marco,

 

I also work around the problem by using a combobox.

 

Thank,

0 Likes