有什么方法可以强制 Infragistics Ultragrid 在最后一列上按向右箭头键时不移动到行下方?
例如,在下面的表格中,位于具有“C”值的单元格(COL_1,第1行) - 如果我按右箭头键,它会将我移动到下面的行(D值),而我想留在同一行,相同单元格(当我到达行的“末尾”时)
COL_A | COL_B | COL_C
1 A B C
2 D ...
最佳答案
UltraGrid 的 KeyDown
事件也可用于实现此功能:
private void ultraGrid1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Right && sender is UltraGrid ug)
{
if ((ug.CurrentState & UltraGridState.CellLast) == UltraGridState.CellLast)
e.Handled = true;
}
}
关于c# - Infragistics Ultragrid - 选择最右边的列时不要移动到行下方,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63826512/