Silverlight组合框SelectedIndex不会改变绑定

时间:2012-01-04 13:09:53

标签: xaml c#-4.0 silverlight-3.0

在我的Silverlight 3.0应用程序中,我的数据网格中有一个与一个类绑定的组合框。 当我更改组合框时,我可以获得该类的索引,但是当我以编程方式更新类时,组合框不会改变。

<data:datagridtemplatecolumn header="Sale Unit" width="80" xmlns:data="#unknown">
<data:datagridtemplatecolumn.celleditingtemplate>
<datatemplate>
<combobox itemspanel="{Binding RelativeSource={RelativeSource Self}}" datacontext="{Binding}" selectedindex="{Binding Path=cursunit,Mode=TwoWay}" keydown="ComboBox_KeyDown" loaded="ComboBox_Loaded" selectionchanged="ComboBox_SelectionChanged">
<comboboxitem content="BOX" />
<comboboxitem content="STRIP" />
<comboboxitem content="PEICE" />
</combobox>
</datatemplate>
</data:datagridtemplatecolumn.celleditingtemplate>
</data:datagridtemplatecolumn>

1 个答案:

答案 0 :(得分:0)

您绑定所选索引的路径,是否实现了INotifyPropertyChanged和触发属性更改?如果不是那可能是问题。

相关问题