Home Forums WinForms controls Xceed Grid for WinForms Insertion row confusion Reply To: Insertion row confusion

User (Old forums)
Member
Post count: 23064

You can handle the KeyUp event, and call EndEdit() on the InsertionRow to commit the changes (thus to add the row to the grid).  Note however that you need to add the handler on the first cell, not the last one, because the Tab key is raised on the next cell from the one on which you are when pressing the Tab key.

e.g.:

private void Form1_Load(object sender, EventArgs e)

{

    insertionRow1.Cells[ “First Column” ].KeyUp += new KeyEventHandler( FirstCell_KeyUp );

}

void FirstCell_KeyUp( object sender, KeyEventArgs e )

{

    if( e.KeyCode == Keys.Tab )

    {

        insertionRow1.EndEdit();

    }

}

Imported from legacy forums. Posted by André (had 527 views)