回复 6楼loacher的帖子
这样的话,你需要自定义一个IAction,并将它注册给Tab键到MultiRow的快捷方式当中。
参考下面的代码:
- public class CustomMoveToNextCell : IAction
- {
- public string DisplayName
- {
- get { return "CustomMoveToNextCell"; }
- }
- public bool CanExecute(GcMultiRow target)
- {
- return SelectionActions.MoveToNextCell.CanExecute(target);
- }
- public void Execute(GcMultiRow target)
- {
- if (this.CanExecute(target))
- {
- SelectionActions.MoveToNextCell.Execute(target);
- CellPosition currentPos = target.CurrentCellPosition;
- Cell currentCell = target[currentPos.RowIndex,currentPos.CellIndex];
- if ("currentCell 不满足TapStop的条件")
- {
- //再往后面寻找一个
- SelectionActions.MoveToNextCell.Execute(target);
- }
- }
- }
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- this.gcMultiRow1.ShortcutKeyManager.DefaultModeList.Remove(new ShortcutKey(SelectionActions.MoveToNextCell, Keys.Tab));
- this.gcMultiRow1.ShortcutKeyManager.DefaultModeList.Add(new ShortcutKey(new CustomMoveToNextCell(), Keys.Tab));
- }
复制代码 |