如何禁用WPF Datagrid中的编辑单元格? [英] How can I disable editing cells in a WPF Datagrid?
问题描述
如何让双击选择完整行,而不是将点击的单元格设置为编辑模式?
WPF DataGrid
有一个 IsReadOnly
属性,您可以设置为 True
以确保用户无法编辑您的 DataGrid
您还可以根据需要为 DataGrid
中的各个列设置此值。
I'm constructing a datagrid in Windows Presentation Foundation, and I have a problem. When a user double-clicks on a cell in my datagrid, the cell goes into edit mode. I want to prevent that. Instead I want users to be able to select the full row - not edit values in it.
How can I make it so that double-clicks select the full row instead of putting the clicked-on cell in edit mode?
The WPF DataGrid
has an IsReadOnly
property that you can set to True
to ensure that users cannot edit your DataGrid
's cells.
You can also set this value for individual columns in your DataGrid
as needed.
这篇关于如何禁用WPF Datagrid中的编辑单元格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!