惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
B
Blog RSS Feed
C
Check Point Blog
D
Docker
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
博客园_首页
Apple Machine Learning Research
Apple Machine Learning Research
量子位
有赞技术团队
有赞技术团队
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
M
MIT News - Artificial intelligence
B
Blog
阮一峰的网络日志
阮一峰的网络日志
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
月光博客
月光博客

博客园 - 木人(我现在不是老大)

ERP系统的专业化发展趋势 讨厌的real和float数据 Svcutil使用点滴 windows server2003企业版64位安装sql server2008企业版64位 读书笔记 UltraGrid(16) 水晶报表使用push模式(2) 水晶报表使用push模式(1) SQL SERVER2000存储过程调试 读书笔记 UltraGrid(15) 读书笔记 UltraGrid(14) 读书笔记 UltraGrid(12) 读书笔记 UltraGrid(10) 读书笔记 UltraGrid(9) 读书笔记 UltraGrid(8) 读书笔记 UltraGrid(7) 读书笔记 UltraGrid(6) 读书笔记 UltraGrid(5) 读书笔记 UltraGrid(4) 读书笔记 UltraGrid(3)
读书笔记 UltraGrid(11)
木人(我现在不是老大) · 2012-02-12 · via 博客园 - 木人(我现在不是老大)

KeyActionMappings键盘映射
ultragrid缺省的键盘映射可通过以下程序得到:
DataTable dt=new DataTable();
dt.Columns .Add("keyCode");
dt.Columns .Add("actionCode");
dt.Columns .Add("stateDisallowed");
dt.Columns .Add("stateRequired");
dt.Columns .Add("specialKeysDisallowed");
dt.Columns .Add("specialKeysRequired");
DataRow row;

foreach (GridKeyActionMapping gkam in this.ultraGrid1.KeyActionMappings)
{
    row = dt.NewRow();
    row["keyCode"] = gkam.KeyCode;
    row["actionCode"] = gkam.ActionCode;
    row["stateDisallowed"] = gkam.StateDisallowed ;
    row["stateRequired"] = gkam.StateRequired ;
    row["specialKeysDisallowed"] = gkam.SpecialKeysDisallowed ;
    row["specialKeysRequired"] = gkam.SpecialKeysRequired ;
    dt.Rows.Add(row);
}
DataView dv = new DataView(dt, string.Empty, "keyCode Asc", DataViewRowState.CurrentRows);
this.ultraGrid1.DataSource = dv;
如果我们想改变其行为,如常见回车进入下一个单元格,则可如此设置:
this.ultraGrid1.KeyActionMappings.Add(new GridKeyActionMapping(
                Keys.Return,
                UltraGridAction.NextCellByTab,
                0,
                UltraGridState.Cell,
                SpecialKeys.All,
                0));