Hi,
I want to create RadioButtons in a stackpanel dynamically based on the user input in a textbox. I am unable to bind it and no radiobuttons are visible . My xaml code is below :---
<Grid>
<TextBlock Name="textBlock1" Text="Enter the no of Radio Buttons :" />
<TextBox Name="textBox1" VerticalAlignment="Top">
<TextBox.Text>
<Binding Path="RDBCount" UpdateSourceTrigger="PropertyChanged" NotifyOnSourceUpdated="True"/>
</TextBox.Text>
</TextBox>
<StackPanel >
<ItemsControl ItemsSource="{Binding States}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<RadioButton GroupName="Same" Content="{Binding StateName, NotifyOnSourceUpdated=True}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</Grid>
In the code page - States is a collection of Radiobutton and RDBCount is no of count which binded with user input in a textbox.
Please help me how to bind this two properties to work.
Thanks-