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
520
Column should get editable on focus
posted

Hi,

I am using a grid with last column as editable.

 

My requirement is if user tabs out of the first row last column the focus should go automatically to

2nd row last column and the column should be in ediatble mode.

Can anybody help me to acheive the same?

Parents
  • 27093
    Verified Answer
    posted

    Hello ,

     

    You can use the XamDataGrid’s PreviewKeyDown event and use its ExecuteCommand Method to manipulate the grid yourself. Here is a sample code snippet where 4 is the index of the last column:

     

    private void xamDataGrid1_PreviewKeyDown(object sender, KeyEventArgs e)

    {

        if ((e.Key == Key.Tab) && (xamDataGrid1.ActiveCell.Field.Index == 4))

        {              

            xamDataGrid1.ExecuteCommand(DataPresenterCommands.CellBelow);              

            xamDataGrid1.ExecuteCommand(DataPresenterCommands.StartEditMode);

            e.Handled = true;

        }

    }

     

    Hope this helps.

     

    Sincerely,

    Petar Monov

    Developer Support Engineer

    Infragistics Bulgaria

    www.infragistics.com/support

Reply Children