回复 1楼zongxudong的帖子
zongxudong 你好,
经确认,DataValidator 无法自定义。
你可以通过 EditEnd 事件来验证输入文本:
- void gcSpreadSheet1_EditEnd(object sender, GrapeCity.Windows.SpreadSheet.UI.EditCellEventArgs e)
- {
- GrapeCity.Windows.SpreadSheet.UI.SpreadView sview = sender as GrapeCity.Windows.SpreadSheet.UI.SpreadView;
- if (sview.CellEditor is TextBox)
- {
- TextBox tb = (TextBox)sview.CellEditor;
- tb.KeyDown -= new KeyEventHandler(tb_KeyDown);
- tb.KeyDown += new KeyEventHandler(tb_KeyDown);
- }
- }
- void tb_KeyDown(object sender, KeyEventArgs e)
- {
- }
复制代码 |