我想获得GridControl(DevExpress)中选择的对象列表
你知道我怎么能这样做吗?
<dxg:GridControl ItemsSource="{Binding Cars}">
答案 0 :(得分:0)
找到了这样做的方法。
方式1
如果使用DevExpress 15.5(我不愿意),只需使用SelectedItem
属性:https://documentation.devexpress.com/#WPF/DevExpressXpfGridDataControlBase_SelectedItemstopic
方式2
如果您有以下内容,则创建一个将GridView挂钩在GridControl中的行为:
<dxg:GridControl ItemsSource="{Binding Cars}">
<dxg:GridControl.View>
<Controls:TableView >
<i:Interaction.Behaviors>
<view:CollectionObserverBehavior SelectedItems="{Binding SelectedCars}" />
</i:Interaction.Behaviors>
</Controls:TableView>