[wpf] How can I disable editing cells in a WPF 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?

This question is related to wpf datagrid wpfdatagrid cells

The answer is


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.


Similar questions with wpf tag:

Similar questions with datagrid tag:

Similar questions with wpfdatagrid tag:

Similar questions with cells tag: