BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
private void gridDataBoundGrid1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell; if(e.KeyCode == Keys.Up && cc.RowIndex > this.gridDataBoundGrid1.Model.Rows.HeaderCount + 1) { GridRangeInfo currentRange = GridRangeInfo.Row(cc.RowIndex); GridRangeInfo newRange = GridRangeInfo.Row(cc.RowIndex - 1); GridSelectionChangingEventArgs se = new GridSelectionChangingEventArgs(newRange, GridSelectionReason.ArrowKey, GridRangeInfo.Empty); this.gridDataBoundGrid1.Model.RaiseSelectionChanging(se); if(!se.Cancel) { this.gridDataBoundGrid1.Selections.ChangeSelection(currentRange, newRange, false); this.gridDataBoundGrid1.CurrentCell.InternalMove(GridDirectionType.Up, 1, GridSetCurrentCellOptions.None); } e.Handled = true; } else if(e.KeyCode == Keys.Down && cc.RowIndex < this.gridDataBoundGrid1.Model.RowCount) { GridRangeInfo currentRange = GridRangeInfo.Row(cc.RowIndex); GridRangeInfo newRange = GridRangeInfo.Row(cc.RowIndex + 1); GridSelectionChangingEventArgs se = new GridSelectionChangingEventArgs(newRange, GridSelectionReason.ArrowKey, GridRangeInfo.Empty); this.gridDataBoundGrid1.Model.RaiseSelectionChanging(se); if(!se.Cancel) { this.gridDataBoundGrid1.Selections.ChangeSelection(currentRange, newRange, false); this.gridDataBoundGrid1.CurrentCell.InternalMove(GridDirectionType.Down, 1, GridSetCurrentCellOptions.None); } e.Handled = true; } }