Current DataGridCell or getting IsEditing state

Jun 26, 2009 at 4:51 AM

how can I access current DataGridCell?

more specifically I want to see if the grid IsEditing is true and DataGridCell seem to have this info.

Jun 26, 2009 at 5:19 AM

to be even more specific, if ItemsSource collection is modified and datagrid isn't in edit mode, I want to focus it and switch editing for the new row. what's the best way to do this?

Jun 26, 2009 at 8:32 AM
Edited Jun 26, 2009 at 8:38 AM

To establish if the grid is being edited you can catch the PreparingCellForEdit event and set a flag that the grid is being editing, and then also catch the CellEditEnding event to clear the flag.

Jun 26, 2009 at 3:54 PM

thank you. what is the rationaly for not having access to the current row or cell (other than cell info). are those objects generated / disposed on the fly in response to scrolling?