你好,可以使用 HyperLinkCellType 单元格类型实现,示例如下:
- DataTable test = new DataTable();
- test.Columns.Add(new DataColumn("col1"));
- test.Columns.Add(new DataColumn("col2"));
- test.Columns.Add(new DataColumn("col3"));
- test.Columns.Add(new DataColumn("col4"));
- test.Rows.Add("超级链接", "超级链接", "超级链接", "超级链接");
- test.Rows.Add("超级链接", "超级链接", "超级链接", "超级链接");
- test.Rows.Add("超级链接", "超级链接", "超级链接", "超级链接");
- test.Rows.Add("超级链接", "超级链接", "超级链接", "超级链接");
- test.Rows.Add("超级链接", "超级链接", "超级链接", "超级链接");
- FpSpread1.ActiveSheetView.DataSource = test;
- FarPoint.Web.Spread.HyperLinkCellType hlcell = new FarPoint.Web.Spread.HyperLinkCellType();
- hlcell.NavigateUrl = "http://gcdn.grapecity.com";
- hlcell.Target = "_blank";
- FpSpread1.ActiveSheetView.Columns[0].CellType = hlcell;
- FpSpread1.ActiveSheetView.Columns[0].Width = 150;
复制代码 |