找回密码
 立即注册

QQ登录

只需一步,快速开始

wangxuemeicheny

主题

帖子

积分

积分
  • 金币

  • 主题

  • 帖子

wangxuemeicheny
  /  发表于:2011-12-13 22:26  /   查看:5148  /  回复:3
提示: 作者被禁止或删除 内容自动屏蔽

3 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2011-12-14 09:46:00
沙发
你好,只需要在绑定数据库后,把该列的类型指定为 CheckBoxCellType 即可:
代码如下:

  1.             //初始化数据
  2.             DataTable _test = new DataTable();
  3.             _test.Columns.Add(new DataColumn("checkbox"));
  4.             _test.Rows.Add("0");
  5.             _test.Rows.Add("0");
  6.             _test.Rows.Add("0");
  7.             _test.Rows.Add("0");
  8.             _test.Rows.Add("0");
  9.             _test.Rows.Add("1");
  10.             _test.Rows.Add("1");
  11.             _test.Rows.Add("1");
  12.             _test.Rows.Add("1");
  13.             _test.Rows.Add("1");

  14.             //绑定数据到 Spread
  15.             this.FpSpread1.ActiveSheetView.DataSource = _test;

  16.             //创建 CheckBoxCellType
  17.             FarPoint.Web.Spread.CheckBoxCellType _checkBoxType = new FarPoint.Web.Spread.CheckBoxCellType();

  18.             //设置第一列数据类型
  19.             this.FpSpread1.ActiveSheetView.Columns[0].CellType = _checkBoxType;
复制代码
效果图:

png

png
回复 使用道具 举报
wangxuemeicheny
  /  发表于:2011-12-19 23:11:00
板凳
提示: 作者被禁止或删除 内容自动屏蔽
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2011-12-20 09:01:00
地板

回复 3# wangxuemeicheny 的帖子

好的~不客气
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部