Hello,
I am using a UltrWinGrid and I am having trouble with the cells in the Grid.
If I use arrow keys to navigate the cells. For some reason when I press any of the arrow keys the cell focus moves from right to left. Even if I press the down or up arrow key the behavior is to move from right to left across the screen. Once the row is completed then the focus shifts to the cells in the next row below I am not sure what is happening.
Other thing I noticed was that when I click on a cell in a row which is not editable and press the backspace the whole row turns Grey. Not sure why this is happening either.
Hoping for some help as i am still learning how to use UltraWinGrid and its functions.
Thanks,Ashwin
I have this code for tracking the key press event but for some reason it does not even get to this code when I run it in Debug mode
this.dgItems.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dgItems_KeyDown);
switch (e.KeyCode)
{
case Keys.Up:
dgItems.PerformAction(UltraGridAction.ExitEditMode, false, false);
int saveActiveCellIndex = dgItems.ActiveCell.Column.Index;
if (dgItems.ActiveRow.Index > 0)
dgItems.ActiveRow = dgItems.Rows[dgItems.ActiveRow.Index - 1];
dgItems.ActiveCell = dgItems.ActiveRow.Cells[saveActiveCellIndex];
}
e.Handled = true;
dgItems.PerformAction(UltraGridAction.EnterEditMode, false, false);
break;
case Keys.Down:
int saveActiveCellIndexs = dgItems.ActiveCell.Column.Index;
if (dgItems.ActiveRow.Index < dgItems.Rows.Count - 1)
dgItems.ActiveRow = dgItems.Rows[dgItems.ActiveRow.Index + 1];
dgItems.ActiveCell = dgItems.ActiveRow.Cells[saveActiveCellIndexs];
case Keys.Left:
dgItems.PerformAction(UltraGridAction.PrevCell, false, false);
case Keys.Right:
dgItems.PerformAction(UltraGridAction.NextCell, false, false);
Hi,
If the event is not firing (Debug mode or otherwise), then something is wrong. Are you sure you are hooking the event? Is it getting unhooked somewhere else in your code? Is there a toolbar or something on the form that might be eating the arrow keys?