回复 1楼tingche的帖子
tingche 你好,
Spread 提供 ButtonCellType 和 HyperLinkCellType,参考代码如下:
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- {
- return;
- }
- //按钮单元格类型
- FarPoint.Web.Spread.ButtonCellType btn = new FarPoint.Web.Spread.ButtonCellType();
- btn.ButtonType = FarPoint.Web.Spread.ButtonType.LinkButton;
- btn.Text = "链接形式按钮";
- this.FpSpread1.Sheets[0].Cells[0, 0].CellType = btn;
- //超链接单元格类型
- FarPoint.Web.Spread.HyperLinkCellType hlcell = new FarPoint.Web.Spread.HyperLinkCellType("str1");
- hlcell.NavigateUrl = "http://www.gcpowertools.com.cn/";
- hlcell.Target = "_self";
- FpSpread1.ActiveSheetView.Cells[1, 0].CellType = hlcell;
- FpSpread1.ActiveSheetView.Columns[0].Width = 150;
- }
复制代码 |