找回密码
 立即注册

QQ登录

只需一步,快速开始

houdawei

最新发帖
iceman
社区贡献组   /  发表于:2014-10-13 18:11:00
沙发
回复 1楼houdawei的帖子

我是通过以下方法添加 LinkButton 的,如果需要参数不同,那么需要设置多个 CellType,制定不同的 CommandName 才能实现:

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

  7.             DataTable dt = new DataTable();
  8.             dt.Columns.Add("col1", typeof(string));

  9.             dt.Rows.Add("1");
  10.             dt.Rows.Add("1");
  11.             dt.Rows.Add("1");
  12.             dt.Rows.Add("1");

  13.             //this.FpSpread1.ActiveSheetView.AutoGenerateColumns = false;
  14.             //this.FpSpread1.ActiveSheetView.DataAutoCellTypes = false;

  15.             this.FpSpread1.ActiveSheetView.DataSource = dt;

  16.             this.FpSpread1.ActiveSheetView.Columns.Add(0, 1);
  17.             FarPoint.Web.Spread.ButtonCellType linkButton = new FarPoint.Web.Spread.ButtonCellType();
  18.             linkButton.ButtonType = FarPoint.Web.Spread.ButtonType.LinkButton;
  19.             linkButton.CommandName = "MyCommand";
  20.             FpSpread1.Sheets[0].Columns[0].CellType = linkButton;
  21.         }
复制代码
回复 使用道具 举报
12
您需要登录后才可以回帖 登录 | 立即注册
返回顶部