回复 7楼jd6061的帖子
以下是我使用VB.NET 写的示例:
- Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
- If IsPostBack Then
- Return
- End If
- FpSpread1.Sheets(0).ColumnCount = 7
- FpSpread1.Sheets(0).RowCount = 50
- For index = 0 To 49
- Dim btn As New FarPoint.Web.Spread.ButtonCellType()
- btn.ButtonType = FarPoint.Web.Spread.ButtonType.LinkButton
- btn.CommandName = Format(index + 1, "000")
- btn.Text = Format(index + 1, "000")
- FpSpread1.Sheets(0).Cells(index, 0).CellType = btn
- Next
- End Sub
- Private Sub FpSpread1_ButtonCommand(sender As Object, e As FarPoint.Web.Spread.SpreadCommandEventArgs) Handles FpSpread1.ButtonCommand
- Dim link As String = e.CommandName
- End Sub
复制代码
如果需要跳转页面可以通过 e.CommandName 获取命令,在buttoncommand事件中跳转页面。
看是否符合您的需求。
SetStyleInfo 用于设置单元格、行或列的样式。 |