XamDockManager – Setting keyboard focus back to the add row

For a project at work we needed the ability for the user to use the tab button on an Infragistics XamDataGrid to submit the record they are adding and set the focus back to the first cell of the data grid. For whatever reason this is not a built in method (have they not tried to do a lot of data entry?), so I came up with my own solution based on a post on the Infragistics forums.

I’ve included the gist below in case anyone else needs this ability (or can find a better way of doing it). You just need to add a PreviewKeyDown event handler to the grid, like below.