Hi, I have a simple XamDataGrid where on each row there are one or two fields that take input and ultimately I'd like to give focus to the input control when the cell is tabbed to.
The fields that I am having a problem with are those that have our own "numeric" text boxes. These only allow numeric input and are adorned red if not populated and mandatory.
It is because of this special-ish functionality that we are not using an EditorType of TextEditor with an EditAsType of Int32 but instead provide a control template essentially of a TextBox.
I can intercept focus coming to the grid via a tab and then use a combination of CellActivated and ElectricityMeterGrid.ExecuteCommand(DataPresenterCommands.CellNextByTab) to get to the correct tab but I can't put the cell into edit mode and force the TextBox to be selected. The closest I get to is the cell containing the textbox being selected.
Help, my hair has gone grey!
Thanks and kind regards.
Andy
As expected that absolutely solved my issue!
Thanks very much. I just wished I'd posted before spending a day on it ;-)
The easiest way to handle this would be to use the editor infrastructure. I have a blog post that demonstrates using a custom editor to host any controls.