Who*_*nja 1 .net c# wpf mvvm
有两种情况:
您选择一行并按删除键删除行.
您选择一个单元格,当其文本突出显示时,按删除键删除文本.
我如何区分这两者?在这两种情况下我都会捕获PreviewKeyPress并且Key是Delete Key,所选行是相同的.
Rob*_*ben 8
用于识别按键的来源,捕获e.OriginalSource在PreviewKeyPress(..)并检查铸造是否DataGridRow或DatagridCell成功.
e.OriginalSource
PreviewKeyPress(..)
DataGridRow
DatagridCell
DataGrid 有IsReadOnly属性.
DataGrid
IsReadOnly
归档时间:
15 年,8 月 前
查看次数:
6499 次
最近记录: