Q:

WPF DataGrid - Set a cell into edit mode programmatically

I have a WPF DataGrid that shows some data records (bounded to an ObservableCollection).
When the user clicks "Edit" button, the currend selected row should move into edit-mode (As if the user double-clicked this row).

How do I do that?

A:

Assuming WPF:
<DataGrid x:Name="dg".... />

Then this code will work:
dg.CurrentCell = new DataGridCellInfo(dg.Items[i], dg.Columns[j]);
dg.BeginEdit();

A:

Here is the documentation of the WPF DataGrid on MSDN. The BeginEdit method seems to be what you are looking for.
PS: I don't know if this is suitable for your application, but many DataGrid users find Single-Click Editing useful.

