找回密码
 立即注册

QQ登录

只需一步,快速开始

liujs_grape

新手上路

1

主题

3

帖子

33

积分

新手上路

积分
33
  • 30

    金币

  • 主题

  • 帖子

最新发帖

[已处理] FpSpread showEditor

liujs_grape
新手上路   /  发表于:2012-2-20 11:07  /   查看:18717  /  回复:3
如何使FpSpread 可编辑文本框在值改变的时候设置背景颜色!!!

3 个回复

倒序浏览
liujs_grape
新手上路   /  发表于:2012-2-20 11:12:00
沙发

FpSpread showEditor

FarPoint.Web.Spread.Extender.DateCalendarCellType dc = new FarPoint.Web.Spread.Extender.DateCalendarCellType();
            dc.Animated = true;
            dc.DateFormat = "MM/dd/yyyy";
            dc.EnableOnClient = true;
            dc.ShowEditor = true;
            FpSpread1.ActiveSheetView.Cells[0, 0].CellType = dc;
回复 使用道具 举报
liujs_grape
新手上路   /  发表于:2012-2-20 11:25:00
板凳
怎么改变文本框颜色,难道一定要用js操作?
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2012-2-20 12:00:00
地板

回复 3# liujs_grape 的帖子

liujs_grape 你好,
可以通过后台 UpdateCommand 实现:
方法描述:DateCalendarCellType 下属性 OnClientDateSelectionChanged 定义定义前台方法 Post 到后台 UpdateCommand 事件中。
参考代码:
前台:

  1.     <style type="text/css">
  2.         .test
  3.         {
  4.             background-color:Red;
  5.          }
  6.     </style>
  7.     <script type="text/javascript">
  8.         function datechange() {
  9.             FpSpread1.UpdatePostbackData();
  10.             FpSpread1.CallBack("Update");

  11.         }
  12.     </script>
复制代码
后台:
  1.         protected void Page_Load(object sender, EventArgs e)
  2.         {
  3.             FarPoint.Web.Spread.Extender.DateCalendarCellType dc = new FarPoint.Web.Spread.Extender.DateCalendarCellType();
  4.             dc.Animated = true;
  5.             dc.DateFormat = "MM/dd/yyyy";
  6.             dc.EnableOnClient = true;
  7.             dc.ShowEditor = true;
  8.             dc.OnClientDateSelectionChanged = "datechange";
  9.             FpSpread1.ActiveSheetView.Cells[0, 0].CellType = dc;
  10.         }

  11.         protected void FpSpread1_UpdateCommand(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e)
  12.         {
  13.             FarPoint.Web.Spread.Extender.DateCalendarCellType dc = (FarPoint.Web.Spread.Extender.DateCalendarCellType)this.FpSpread1.Sheets[0].Cells[0, 0].CellType;
  14.             dc.CssClass = "test";
  15.         }
复制代码
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部