Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
50
SetFocus On Cell's content control when tabbed to.
posted

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