This is a migrated thread and some comments may be shown as answers.

Group of Toggle Buttons

3 Answers 929 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
Sreeju
Top achievements
Rank 1
Sreeju asked on 23 Dec 2010, 08:07 AM
Hi,

How i can implement group of Toggle Button, one button will be active at a time.

Please suggest/provide sample code.


Regards, Sreeju

3 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 25 Dec 2010, 08:39 PM
Hello Sreeju,

You can choose from a couple of approaches in order to implement this scenario. You can handle the RadToggleButtons Checked() event to uncheck every other  ToglleButton in the group. You can also use the RadToggleButton in an ItemTemplate for a ListBoxItem and bind the IsChecked property to the IsSelected property of the ListBoxItems.

You can also use the RadRadioButton instead of the RadToggleButton since it implements this functionality out-of-the-box.

I prepared a sample project illustrating all of these approaches. I hope it will help you choose the best approach towards your scenario.

Regards,
Tina Stancheva
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Seth
Top achievements
Rank 1
answered on 28 Mar 2011, 02:23 PM
Tina--

How can I set up 2 separate groups of RadRadioButtons?  The selections in one should not affect the selections in the other.

Thanks,
Seth
0
Tina Stancheva
Telerik team
answered on 31 Mar 2011, 03:01 PM
Hi Seth,

If you define the RadRadioButtons in different panels (StackPanels/Grids), this will automatically defined them in different groups as you need.

Also, you can take advantage of the RadRadioButton GroupName property and set different GroupNames to the buttons in different groups.

I hope this info will help you.

All the best,
Tina Stancheva
the Telerik team
Tags
Buttons
Asked by
Sreeju
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Seth
Top achievements
Rank 1
Share this question
or