4
我知道這已被問過。我正在檢查是否有任何新的聰明解決方案。有沒有更好的方法來綁定DataGridComboBoxColumn
的SelectedIndex
?這是我得到了結合後多谷歌搜索工作:綁定DataGridComboBoxColumn SelectedIndex
<!-- This is a little ridiculous -->
<DataGridComboBoxColumn Header="Batch Type"
ItemsSource="{Binding Source={StaticResource methodOfPaymentItemsProvider}}">
<DataGridComboBoxColumn.ElementStyle>
<Style TargetType="ComboBox">
<Setter Property="SelectedIndex"
Value="{Binding MethodOfPayment,
UpdateSourceTrigger=PropertyChanged}" />
</Style>
</DataGridComboBoxColumn.ElementStyle>
<DataGridComboBoxColumn.EditingElementStyle>
<Style TargetType="ComboBox">
<Setter Property="SelectedIndex"
Value="{Binding MethodOfPayment,
UpdateSourceTrigger=PropertyChanged}" />
</Style>
</DataGridComboBoxColumn.EditingElementStyle>
</DataGridComboBoxColumn>
而你的問題是? – Botonomous