找回密码
 立即注册

QQ登录

只需一步,快速开始

tonyjiaxing

新手上路

1

主题

2

帖子

32

积分

新手上路

积分
32
  • 30

    金币

  • 主题

  • 帖子

最新发帖
tonyjiaxing
新手上路   /  发表于:2015-3-24 16:04  /   查看:5037  /  回复:3
如图所示,这样的操作怎么实现?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

3 个回复

倒序浏览
Alice
社区贡献组   /  发表于:2015-3-24 18:08:00
沙发
回复 1楼tonyjiaxing的帖子

MultiRow默认的Command是没有提供你需求中的行为。
因此你需要首先自定义Command来实现你的行为,这可以继承ICommand接口,实现自己的逻辑。

然后将Shift Tab键和你自定义的Command绑定,MultiRow有Shortcutkeys可以实现这点。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
tonyjiaxing
新手上路   /  发表于:2015-3-25 12:48:00
板凳
回复 2楼Alice的帖子

找不到ICommand接口,能否再说的详细一点
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2015-3-25 16:58:00
地板
回复 3楼tonyjiaxing的帖子

可以通过自定义 Action 来实现:

  1. public class MyAction : GrapeCity.Win.MultiRow.Action
  2.     {
  3.         public override bool CanExecute(GcMultiRow target)
  4.         {
  5.             return true;
  6.         }

  7.         protected override void OnExecute(GcMultiRow target)
  8.         {
  9.             if (target.CurrentCellPosition.RowIndex == 0 && target.CurrentCellPosition.CellIndex == 3)
  10.             {
  11.                 ComponentActions.SelectPreviousControl.Execute(target);
  12.             }
  13.             else
  14.             {
  15.                 SelectionActions.MoveToPreviousCell.Execute(target);
  16.             }
  17.         }
  18.     }
复制代码


调用方法:

  1. this.gcMultiRow1.ShortcutKeyManager.Register(new MyAction(), Keys.Shift | Keys.Tab);
复制代码
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部