Changing Edit triggers

Jan 29, 2009 at 10:21 PM
I'd like to prevent double-clicking from initiating an edit action on the cell that was double clicked.  I'd prefer that only F2 initiates editing.  Ideally, I would like to set this option only on certain columns.

I can't find a property on DataGridColumn for this; is there a setting elsewhere?
Feb 2, 2009 at 1:42 PM
I haven't tried it, but you could probably use the PreviewMouseDoubleClick event, figure out which column is selected (see http://www.scottlogic.co.uk/blog/wpf/2008/12/wpf-datagrid-detecting-clicked-cell-and-row/ for an example of how to do this), and set e.Handled accordingly.
Coordinator
Feb 3, 2009 at 5:00 AM
In conjunction with mikj's suggestion, you can also listen to the DataGrid.BeginningEdit event and stop editing from happenning there as well.