找回密码
 立即注册

QQ登录

只需一步,快速开始

默默

初级会员

8

主题

31

帖子

272

积分

初级会员

积分
272
默默
初级会员   /  发表于:2017-9-5 18:25  /   查看:3787  /  回复:9
5金币
本帖最后由 默默 于 2017-9-13 14:20 编辑

在spread的单元格里,判断每次输入的值,是否为uint,或者是否超过4个字节

11 个回复

倒序浏览
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2017-9-6 20:20:11
沙发
您好,您说的unit是什么概念,如果是限制长度可以使用TextCellType 的MaxLength

FarPoint.Web.Spread.TextCellType textcell = new FarPoint.Web.Spread.TextCellType();
textcell.MaxLength = 5;
FpSpread1.Sheets[0].Cells[0, 0].CellType = textcell;
回复 使用道具 举报
默默
初级会员   /  发表于:2017-9-7 14:28:04
板凳
本帖最后由 默默 于 2017-9-7 14:29 编辑
dexteryao 发表于 2017-9-6 20:20
您好,您说的unit是什么概念,如果是限制长度可以使用TextCellType 的MaxLength

FarPoint.Web.Spread.Te ...

uint就是c#里面的,无符号int型,还有ushort,我也是初学者,根据协议,写东西,有说不明白的,请多多包涵
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2017-9-7 17:09:25
地板
限制数字可以用IntegerCellType

FarPoint.Web.Spread.IntegerCellType i = new FarPoint.Web.Spread.IntegerCellType();
i.MaximumValue = 50;
i.MinimumValue = 1;
i.ErrorMessage = "Value must be between 1 and 50";
FpSpread1.ActiveSheetView.Cells[0, 0].CellType = i;
回复 使用道具 举报
默默
初级会员   /  发表于:2017-9-8 08:10:54
5#
dexteryao 发表于 2017-9-7 17:09
限制数字可以用IntegerCellType

FarPoint.Web.Spread.IntegerCellType i = new FarPoint.Web.Spread.Int ...

用放在哪个事件里吗?
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2017-9-8 11:40:29
6#
不用,初始化时候设置好就行,或者你可以在设计器里设置。

设计器在aspx 的设计页面上然后spread表格上点击右键就有

点评

ok  发表于 2017-9-8 14:23
回复 使用道具 举报
默默
初级会员   /  发表于:2017-9-12 15:27:45
7#
本帖最后由 默默 于 2017-9-12 16:07 编辑
dexteryao 发表于 2017-9-7 17:09
限制数字可以用IntegerCellType

FarPoint.Web.Spread.IntegerCellType i = new FarPoint.Web.Spread.Int ...

您这个类型是web型的啊,我的是farpoint。win的,我的这里面没有这个类型的
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2017-9-12 18:43:21
8#
哦,您把帖子发到aspnet 专区了。
winfrom 有NumberCellType ,我把您帖子移动到winfrom专区,下次在那里发帖

  1. FarPoint.Win.Spread.CellType.NumberCellType num = new FarPoint.Win.Spread.CellType.NumberCellType();
  2. num.DecimalPlaces = 3;
  3. num.DecimalSeparator = ",";
  4. num.FixedPoint = true;
  5. num.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.UseRegional;
  6. num.MaximumValue = 50000.0;
  7. num.MinimumValue = -1000.0;
复制代码

点评

z怎么设置为已处理  发表于 2017-9-13 14:19
回复 使用道具 举报
默默
初级会员   /  发表于:2017-9-13 14:17:27
9#
dexteryao 发表于 2017-9-12 18:43
哦,您把帖子发到aspnet 专区了。
winfrom 有NumberCellType ,我把您帖子移动到winfrom专区,下次在那里 ...

好的
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2017-9-13 18:06:12
10#
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部