找回密码
 立即注册

QQ登录

只需一步,快速开始

cngrain

中级会员

32

主题

118

帖子

656

积分

中级会员

积分
656

活字格认证

cngrain
中级会员   /  发表于:2012-5-11 23:53  /   查看:3887  /  回复:1
在设计时候给指定单元格添加其对应Items和ItemData值,
运行时为何显示的值不是Cell Value: 2   Cell Text:项目2 而是Cell Value: 项目2  Cell Text:项目2 呢?
如图所示:

jpg

jpg


jpg

jpg


代码为:
  1. MessageBox.Show("Cell Value:" + fpSpread1.Sheet[0].Cells[0,1].Value.ToString() +"\r\n Cell Text:" +  fpSpread1.Sheet[0].Cells[0,1].Text);
复制代码
请问如何修改修改或调整, 动态绑定除外!

1 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2012-5-14 10:03:00
沙发

回复 1# cngrain 的帖子

cngrain 你好,
获取 CellValue 方式如下:

  1.             FarPoint.Win.Spread.CellType.ComboBoxCellType comboCellType = this.fpSpread1.Sheets[0].Cells[0, 1].CellType as FarPoint.Win.Spread.CellType.ComboBoxCellType;
  2.             int value = 1;
  3.             foreach (string item in comboCellType.Items)
  4.             {
  5.                 if (item == this.fpSpread1.Sheets[0].Cells[0,1].Text)
  6.                 {
  7.                     break;
  8.                 }
  9.                 value++;
  10.             }
复制代码
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部