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
620
add new row with down arrow key
posted

Im using the wingrid, and have a dynamic datasource attached to it. An ordinary datagridview you just press the downarrow to get a new row to fill. That doesnt seem to be the case with my ultragrid. Am i just missing a property to set ? Im not interested in the addrowbutton unless im absolutely forced to use it

  • 37774
    posted

    I'm not aware of any property that will enable this behavior.  You could probably do this by handling the KeyDown event yourself, i.e.:

    private void ultraGrid1_KeyDown(object sender, KeyEventArgs e)
    {
        if (e.KeyCode == Keys.Down && this.ultraGrid1.ActiveRow != null && this.ultraGrid1.ActiveRow.Index == this.ultraGrid1.Rows.Count - 1)
        {
            e.Handled = true;
            UltraGridRow newRow = this.ultraGrid1.ActiveRow.Band.AddNew();
            newRow.Activate();
        }
    }

    You might want to account for exiting edit mode on certain cells, or not doing this if you're in edit mode.

    -Matt