Home Forums WinForms controls Xceed Grid for WinForms help with InsertionRow

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #16305 |
    Hello,

    I’m using insertionrow for inserting
    data into a grid but I need that the issue is how to move cell to cell with the
    key enter and exit the editing mode when using the arrows up or down arrow,
    there is any way to simulate that? …

    I hope I have been clear and
    thanks for the help.

    Imported from legacy forums. Posted by bandolero (had 1723 views)

    User (Old forums)
    Member
    Post count: 23064

    You can use the QueryInputKey event on the CellEditorManager, and monitor which key is pressed, an act accordingly.  Note that the up or down arrow should already commit the changes to the InsertionRow.

    e.g. :

    private void Form1_Load(object sender, EventArgs e)

    {

        foreach( Column col in gridControl1.Columns )

        {

            col.CellEditorManager.QueryInputKey += new QueryEditorInputKeyEventHandler(CellEditorManager_QueryInputKey);

        }

    }

    void CellEditorManager_QueryInputKey( object sender, QueryEditorInputKeyEventArgs e )

    {

        if( e.Cell.GetType() == typeof( InsertionCell ) )

        {

            //if you want “Enter” on the last cell to commit the insertion data, then do nothing in that case.

            if( e.KeyData == Keys.Enter && e.Cell.ParentColumn.Title != LastCell )

            {

                gridControl1.MoveCurrentCell(

    HorizontalDirection.Right );

                e.IsInputKey =

    true;

            }

        }

    }

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

    User (Old forums)
    Member
    Post count: 23064
    thanks, effective your help

    Imported from legacy forums. Posted by bandolero (had 710 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.