我想要制作两个Combox,如图所示,左边显示Item1,Item2,Item3这样的,右边显示1,2,3。
我想要的效果是:左边点击对应的Item,右边自动显示对应的序列号;右边操作,左边亦然。
我现在的做法是:
<ComboBox Name="items" SelectedIndex="{Binding ElementName=itemsNumber, Path=SelectedIndex}">
<ComboBoxItem>Item1</ComboBoxItem>
<ComboBoxItem>Item2</ComboBoxItem>
<ComboBoxItem>Item3</ComboBoxItem>
</ComboBox>
<ComboBox Name="itemsNumber" SelectedIndex="{Binding ElementName=items, Path=SelectedIndex}">
<ComboBoxItem>1</ComboBoxItem>
<ComboBoxItem>2</ComboBoxItem>
<ComboBoxItem>3</ComboBoxItem>
</ComboBox>
但是这样一点击ComboBox就报错哦。
请高手指点一下。
