找回密码
 立即注册

QQ登录

只需一步,快速开始

Chinaiss

注册会员

7

主题

14

帖子

57

积分

注册会员

积分
57
Chinaiss
注册会员   /  发表于:2016-12-20 17:30  /   查看:3499  /  回复:3
当单元格处于编辑状态时,其他控件对当前单元格赋值时,如何马上显示后台赋值结果

3 个回复

倒序浏览
Lenka.Guo讲师达人认证 悬赏达人认证
超级版主   /  发表于:2016-12-20 17:50:29
沙发
您好,

直接设置Cell.Value 是否可以满足要求
回复 使用道具 举报
Chinaiss
注册会员   /  发表于:2016-12-21 09:03:45
板凳
附上Demo。如下图所示,当单元格处理正在编辑时 value Text赋值后都没有立刻刷新

blob165321959.png

GcSpreadDemo.zip

69.2 KB, 下载次数: 112

Demo

回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2016-12-21 14:09:25
地板
您好,在编辑状态您需要给 CellEditor 直接赋值

  1.         void btnSetValue_Click(object sender, RoutedEventArgs e)
  2.         {
  3.             if (gcSpread.ActiveSheet.ActiveCell != null)
  4.             {
  5.                 if(gcSpread.View.CellEditor != null &&  gcSpread.View.CellEditor is GrapeCity.Windows.SpreadSheet.UI.EditingElement){

  6.                     var control = gcSpread.View.CellEditor as GrapeCity.Windows.SpreadSheet.UI.EditingElement;
  7.                     control.Text += "Hello";
  8.                 }
  9.                 else
  10.                 {
  11.                     gcSpread.ActiveSheet.ActiveCell.Value += "Hello";
  12.                 }
  13.             }
  14.             
  15.         }
复制代码
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部