Group of Toggle Buttons

4 posts, 0 answers
  1. Sreeju
    Sreeju avatar
    4 posts
    Member since:
    Dec 2010

    Posted 23 Dec 2010 Link to this post

    Hi,

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

    Please suggest/provide sample code.


    Regards, Sreeju
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 25 Dec 2010 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Seth
    Seth avatar
    9 posts
    Member since:
    Mar 2009

    Posted 28 Mar 2011 Link to this post

    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
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 31 Mar 2011 Link to this post

    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
Back to Top