Getting the index of the selected RadioButton in a group
I have got a reference to a RadioButton rb1. How can I get the index of the selected RadioButton in rb1's group ? I have googled for a while but without success. Any help will be greatly appreciated If you got to this point then there is probably something wrong with your design and you should reconsider it. that being said you could traverse the visual tree and find it like this: /// Returns the first GroupBox ancester public DependencyObject FindAncestor(DependencyObject current) { current = VisualTreeHelper.GetParent(current); while (current != null) { if (current is GroupBox) { return (T