WPF DataGrid多重编辑 [英] WPF DataGrid MultiEditing
问题描述
现在,我被WPF Datagrid的某些功能所困扰.我需要编辑多个单元格(例如在Excel中):复制和删除值.我也希望该用户能够删除行.
所以我的想法是:
1)重新分配ctrl + c和&ctrl + v热键
2)禁用选项,用户可以删除行,也可以重新分配键Delete以删除单元格的值.但是在这里我有一个问题:如何结合键Delete的这两种行为?
请让我现在,如果我打算做的还是对这些问题的解决方案,请提出建议.
Right now I''m stuck with some feature in WPF Datagrid. I need to edit multiple cells(like in Excel): copy and delete values. Also I want that user would be able to delete rows.
So my thoughts are:
1) Reassign ctrl+c && ctrl+v hotkeys
2) Disable option that user can delete rows and also reassign key Delete to remove cells'' values. But here I got question: How to combine these 2 behaviors of key Delete?
Please, let me now if I''m right in my plan to do or kindly advise some solution to that questions.
推荐答案
对于第二项,您可以处理行标题杆和单元格级别的Delete键.
因此,如果用户在关注标题时按下Delete键,则删除该行.
如果他当前正在关注某个单元格,请删除该单元格的内容.
For the second item, you can handle the Delete key at row header lever and cell level.
SO if a user hits Delete while he is focusing on a header, remove the row.
If he is currently focusing on a cell, remove the cell contents.
这篇关于WPF DataGrid多重编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!