2016-01-25 46 views

回答

0

找到了解決辦法。

路1

如果有DevExpress的15.5(我不),只需使用SelectedItem屬性:https://documentation.devexpress.com/#WPF/DevExpressXpfGridDataControlBase_SelectedItemstopic

路2

創建行爲掛鉤的TableView GridControl內部如果有:

<dxg:GridControl ItemsSource="{Binding Cars}">   
    <dxg:GridControl.View> 
      <Controls:TableView > 
      <i:Interaction.Behaviors> 
       <view:CollectionObserverBehavior SelectedItems="{Binding SelectedCars}" /> 
      </i:Interaction.Behaviors> 
      </Controls:TableView> 

好文章這裏的行爲細節:http://social.technet.microsoft.com/wiki/contents/articles/22871.wpfmvvm-binding-to-read-only-properties-using-behaviors.aspx

相關問題