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
1830
Tabbing Into Combobox in Edit Mode
posted

I need to tab into a xamDataGrid, which would already have the active cell set on a combobox editor, and have that cell go into edit mode upon entry.  I've discovered this is not as simple as calling StartEditMode on the CellValuePresenter in GotFocus, as that caused the event to be called multiple times when moving between grid rows, and I ended up breaking the event model.  Has anyone been able to do this successfully without breaking all the standard navigation built into xamDataGrid?

Parents
No Data
Reply
  • 22015
    posted

    Hello Darryl,

     

    Thank you for your post!

     

    I have been looking into your question. When a Cell of the XamDataGrid is activated the CellActivated event of the XamDataGrid is fired. Using this event you can force the cell, that is currently active to enter in edit mode.

    Here is a code snippet, that you can use:

     

    Dispatcher.BeginInvoke(new Action(() =>

                {

                    CellValuePresenter.FromCell(e.Cell).Editor.StartEditMode();

                }

               ), System.Windows.Threading.DispatcherPriority.Background, null);

     

    I have also created a small sample application for you to show you this functionality. In the attached sample application you have to click on the first cell, in order to activate it. Then by pressing the Tab key you would navigate through the cells and they will enter in edit mode.

     

    Please find the attachment and feel free to let me know if you have any further questions on this matter.

    DataGrid_EditableComboOnTab.zip
Children