Select Default Radio Buuton
Hi,I was added group of radio buttons in DataTemplate ( assume here 10 radio buttons are added dynamically). Now I would need to check one radio button as bydeault checked, how can I achieve this one programmatically or XAML ( WPF).
Sample Code:
<ListBox Name="skinChangeListBox" Height="100" Background="Transparent"
BorderThickness="0"
ItemContainerStyle="{StaticResource SkinChangeListBoxItem}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel IsItemsHost="True" Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Height="96">
<RadioButton IsChecked="True" GroupName="Theme" Content="{Binding Name}" Margin="10,0,0,0" Checked="rdoDefault_Checked"
Style="{StaticResource SettingRadioButton}" Height="22" HorizontalAlignment="Left" VerticalAlignment="Top"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>