找回密码
 立即注册

QQ登录

只需一步,快速开始

费跃

论坛元老

5

主题

16

帖子

6907

积分

论坛元老

积分
6907

活字格认证

最新发帖
费跃
论坛元老   /  发表于:2014-6-30 15:19  /   查看:5329  /  回复:3
10金币
获取spread复选框的值,单击复选框时,获取复选框当前的值。类似datagridview的EditedFormattedValue。的作用。

3 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2014-6-30 17:15:00
沙发
回复 1楼费跃的帖子

可以通过设置 CheckBoxCellType 的 AutoPostBack 属性为 true,通过 ButtonCommand 来获取:

  1.         protected void Page_Load(object sender, EventArgs e)
  2.         {
  3.             if (IsPostBack)
  4.             {
  5.                 return;
  6.             }

  7.             FarPoint.Web.Spread.CheckBoxCellType c = new FarPoint.Web.Spread.CheckBoxCellType();
  8.             c.AutoPostBack = true;
  9.             FpSpread1.ActiveSheetView.Cells[0, 0].CellType = c;

  10.         }

  11.         protected void FpSpread1_ButtonCommand(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e)
  12.         {
  13.             int activeRow = e.SheetView.ActiveRow;
  14.             int activeCol = e.SheetView.ActiveColumn;

  15.             object value = this.FpSpread1.ActiveSheetView.Cells[activeRow, activeCol].Value;
  16.         }
复制代码
回复 使用道具 举报
费跃
论坛元老   /  发表于:2014-7-1 10:51:00
板凳
是winfrom ,没有这个属性
FarPoint.Win.Spread.CellType.CheckBoxCellType ChkType = new FarPoint.Win.Spread.CellType.CheckBoxCellType();
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2014-7-1 15:48:00
地板
回复 3楼费跃的帖子

请您到相应版块发帖,我已经把问题移到 Spread for WinForms 版块,设置方法如下:

  1.         private void Form1_Load(object sender, EventArgs e)
  2.         {
  3.             FarPoint.Win.Spread.CellType.CheckBoxCellType ChkType = new FarPoint.Win.Spread.CellType.CheckBoxCellType();
  4.             this.fpSpread1.ActiveSheet.Columns[0].CellType = ChkType;

  5.             this.fpSpread1.ButtonClicked += fpSpread1_ButtonClicked;
  6.         }

  7.         void fpSpread1_ButtonClicked(object sender, FarPoint.Win.Spread.EditorNotifyEventArgs e)
  8.         {

  9.         }
复制代码
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部