26.11.08

Grouping RadioButtons using the StackPanel element

The problem was how to group a number of radio buttons in a XAML UI. The solution was:


<StackPanel Name="magazineList" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan=">
<RadioButton>By email</RadioButton>
<RadioButton>By mail</RadioButton>
<RadioButton>No magazine</RadioButton>
</StackPanel>


An alternative approach would be to use a named group descriptor.


No comments: