How can I most efficiently set up a grid so that pressing enter will move focus the next row, first editable cell?
Hi Mike;
mike i m using ultragird and keydown event to move the focus to the next row of the same column.
it works fine. but when i drag the column to the header of the group, it works for only one group. it doesn't move to the next group automatically.
following is the code for moving focus to the same cell of the next row:
private void dgvSaleCustomers_KeyDown(object sender, KeyEventArgs e) { switch (e.KeyCode) { case Keys.Down: case Keys.Enter: this.dgvSaleCustomers.PerformAction(UltraGridAction.ExitEditMode, false, false); UltraGridBand b = this.dgvSaleCustomers.DisplayLayout.Bands[0];
if (dgvSaleCustomers.ActiveRow.HasNextSibling(true)) { UltraGridRow nextRow = dgvSaleCustomers.ActiveRow.GetSibling(SiblingRow.Next, true); dgvSaleCustomers.ActiveCell = nextRow.Cells[dgvSaleCustomers.ActiveCell.Column]; e.Handled = true; this.dgvSaleCustomers.PerformAction(UltraGridAction.EnterEditMode, false, false); } break;
Please advice. waiting for your reply!!!!!!!!
GetFirstVisibleCol is a method on the band.
Thanks.
Looks like there is no "GetFirstVisibleColumn" though. Instead:
GetRelatedVisibleColumn(VisibleRelation.First)
You can use the GetFirstVisibleColumn method on the band to get the first visible column. You could then have to loop through the columns until you find one that is editable using GetRelatedVisibleColumn on the column.