How to make DataDrid not editable in WPF?


(SAM) #1

hello everybody!!

I’m making 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.

please someone can help me?


(Sine) #2

You can easily use IsReadOnly property on the DataGrid to make it entirely read only. or use IsReadOnly per Column basis to make them read only.


(afree) #3

The WPF DataGrid has an IsReadOnly property that you can set to True to ensure that users cannot edit your DataGrid's cells.