绑定RadioButtonList
有人可以帮助我吗? 我想绑定列表框的Datatemplate中的RadioButton列表,但它不作为RadioButtonList,即它可以同时选择多个RB。 我在网上看了,但找不到正确的答案 感谢所有帮助绑定RadioButtonList
我的XAML是如下
<ItemsControl x:Name="itcPayTypes" DockPanel.Dock="Top" BorderThickness="0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<RadioButton Content="{Binding PayTypeName}" Click="RadioButton_Click_1"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
喜为所有单选按钮相同的组名。我希望这将有所帮助。
<StackPanel Orientation="Horizontal">
<RadioButton Content="{Binding PayTypeName}" GroupName="abc" Click="RadioButton_Click_1"/>
</StackPanel>
它没有帮助我,因为我不知道按钮是如何出现在列表上的,因为它是一个绑定列表 – IFink 2013-03-04 17:07:35
显示你的xaml。 – ethicallogics 2013-03-04 17:29:21
谢谢您的关注。我在问题 – IFink 2013-03-04 17:42:08
欢迎来到SO。拼写检查,格式和邮政编码。 – Paparazzi 2013-03-04 15:57:55
你说得对,我的英文写得不好 – IFink 2013-03-04 17:12:38