Welcome to the Xceed Community | Help
Community Search  

help with InsertionRow

Sort Posts: Previous Next
  •  07-29-2008, 10:08 PM Post no. 13796

    help with InsertionRow

    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.
    Filed under: , ,
  •  08-05-2008, 3:12 PM Post no. 13905 in reply to 13796

    Re: help with InsertionRow

    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;

            }

        }

    }


    André
    Software Developer and Tech Support
    Xceed Software Inc.
  •  08-11-2008, 12:14 PM Post no. 13998 in reply to 13905

    Re: help with InsertionRow

    thanks, effective your help
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.