没有CTRL或空格的WPF Datagrid多重选择 [英] WPF Datagrid Multiple Selection without CTRL or Space

查看:132
本文介绍了没有CTRL或空格的WPF Datagrid多重选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

WPF Datagrid具有两种选择模式,单一或扩展。 WPF ListView具有第三个-多个。此模式允许您单击并选择多行,而无需按住CTRL或Shift。有人知道如何为数据网格执行此操作吗?

The WPF Datagrid has two selection modes, Single or Extended. The WPF ListView has a third - Multiple. This mode allows you to click and select multiple rows without CTRL or Shift being held down. Anyone know how to do this for the datagrid?

推荐答案

在工具箱的DataGrid中不支持此功能,看起来像它将不受支持当.NET 4附带有DataGrid时。该控件尚未准备好用于生产的另一个原因。我会选择以下选项之一:

This is not supported in the DataGrid in the toolkit, and it looks like it won't be supported when the DataGrid is shipped with .NET 4 either. Yet another reason why this control is not ready for production use. I would go with one of these options:


  1. 使用ListView / GridView滚动自己的网格

  2. 修改工具箱中DataGrid的源代码(既然已经支持扩展选择,应该不会太难吗?)

  3. 查找任何可用的商业WPF DataGrid(通常会添加

我同意DataGrid应该支持此功能,并且我认为您应该为此提交错误/建议。进入.NET 4也许还为时不晚。:)

I agree that the DataGrid should support this and I think you should file a bug/suggestion for this anyway. Maybe it's not too late to get it into .NET 4.. :)

这篇关于没有CTRL或空格的WPF Datagrid多重选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆