有没有办法以编程方式在(虚拟化)DataGrid上设置多选(更好的是通过添加/删除项目集合来修改当前选择),而不是逐个但只需一步 - 只触发一个SelectionChanged事件? 或者某种方式来推迟SelectedItems更改处理,如下面的伪代码:
dataGrid.SelectionChangeStart(); // start to queue selection changes
ModifySelectedItems(dataGrid.SelectedItems); // add/remove items
dataGrid.SelectionChangeEnd(); // now process all the changes at once
编辑:数据网格具有扩展选择模式。