- 积分
- 0
- 在线时间
- 2 小时
- 主题
- 1
- 注册时间
- 2018-6-1
- 帖子
- 6
- 最后登录
- 2018-6-19
- 帖子
- 6
- 软币
- 72
- 在线时间
- 2 小时
- 注册时间
- 2018-6-1
|
<dxg:TableView
x:Name="viewDetail"
NavigationStyle="Cell"
RowIndicatorContentTemplate="{DynamicResource RowIndicatorContentTemplate}"
ShowCheckBoxSelectorColumn="True"
Style="{DynamicResource TableViewStyle}">
<i:Interaction.Behaviors>
<bh:BestFitColumnsBehavior />
</i:Interaction.Behaviors>
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand
Command="{Binding WithdrawEntrustCommand}"
EventArgsConverter="{inf:EventArgsToDataRowConverter}"
EventName="MouseDoubleClick"
PassEventArgsToCommand="True"
SourceName="gridDetail" />
</dxmvvm:Interaction.Behaviors>
</dxg:TableView>
public class EventArgsToDataRowConverter : InstanceMarkupExtension<EventArgsToDataRowConverter>, IEventArgsConverter
{
public object Convert(object sender, object args)
{
var e = (MouseButtonEventArgs)args;
var gridControl = (GridControl)e.Source;
var rowControl = VisualHelper.FindVisualParent<RowControl>(e.OriginalSource as DependencyObject);
var checkEdit = VisualHelper.FindVisualParent<CheckEdit>(e.OriginalSource as DependencyObject);
//屏蔽双击CheckBox或者双击鼠标右键响应双击事件
if (checkEdit != null || rowControl == null || e.ChangedButton != MouseButton.Left)
{
return null;
}
else
{
return gridControl.SelectedItem;
}
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return this;
}
}
仅供参考哦
|
|