Okay, I have a WPF DataGrid which is bound to an Observable Collection of data objects. It's a 2-way binding. I have an "Add" button that adds a data row to the underlying list, scrolls to that item in the DataGrid, and selects that row. All that works perfectly. The UI shows an empty row added to the end of the DataGrid, and that row is selected. However, the user has to click the first cell in order to edit it, which isn't ideal.
:mad:
Once I've gotten this far, how do I tell it to open the first cell into edit mode? I tried the obvious, dataGrid.BeginEdit(), but it didn't do anything that I can see. Still have to click the cell to put it in edit mode. I also tried some solutions culled from online, using the visual tree to select a cell, but that didn't work, either... the cell always came back null.
I have the DataGrid.SelectionUnit set to FullRow, and the SelectionMode set to Extended. I cannot set the SelectionUnit to Cell, because there are several scenarios the user will want to select multiple rows.
So, any idea how to set a column to edit mode from the code-behind?
:mad:
Once I've gotten this far, how do I tell it to open the first cell into edit mode? I tried the obvious, dataGrid.BeginEdit(), but it didn't do anything that I can see. Still have to click the cell to put it in edit mode. I also tried some solutions culled from online, using the visual tree to select a cell, but that didn't work, either... the cell always came back null.
I have the DataGrid.SelectionUnit set to FullRow, and the SelectionMode set to Extended. I cannot set the SelectionUnit to Cell, because there are several scenarios the user will want to select multiple rows.
So, any idea how to set a column to edit mode from the code-behind?