【セル型】ハイパーリンク型セルの文字の色を変更したい
対象製品
SPREAD for ASP.NET 8.0J
詳細
下記サンプルコードのように、CssClassを利用することでハイパーリンク型セルの文字の色を変更することができます。
◎サンプルコード(VB)
◎サンプルコード(C#)
◎サンプルコード(VB)
------------------------
Webフォームクラス
------------------------
Protected Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load, Me.Load
If Page.IsPostBack Then
Return
End If
Dim hl As New FarPoint.Web.Spread.HyperLinkCellType
hl.CssClass = "myhl" 'CSSクラスを設定
hl.NavigateUrl = "https://dev.grapecity.co.jp/support/kb/"
FpSpread1.ActiveSheetView.Cells(1, 1).CellType = hl
FpSpread1.ActiveSheetView.Cells(1, 1).Text = "FAQ"
End Sub
-------------------------------
HTML
-------------------------------
<style type="text/css">
.myhl a:link{ color: #990000; }
.myhl a:visited{ color: #FF6600; }
.myhl a:hover{ background-color: #333300; color: #FFFFFF; }
</style>
Webフォームクラス
------------------------
Protected Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load, Me.Load
If Page.IsPostBack Then
Return
End If
Dim hl As New FarPoint.Web.Spread.HyperLinkCellType
hl.CssClass = "myhl" 'CSSクラスを設定
hl.NavigateUrl = "https://dev.grapecity.co.jp/support/kb/"
FpSpread1.ActiveSheetView.Cells(1, 1).CellType = hl
FpSpread1.ActiveSheetView.Cells(1, 1).Text = "FAQ"
End Sub
-------------------------------
HTML
-------------------------------
<style type="text/css">
.myhl a:link{ color: #990000; }
.myhl a:visited{ color: #FF6600; }
.myhl a:hover{ background-color: #333300; color: #FFFFFF; }
</style>
◎サンプルコード(C#)
-----------------------
Webフォームクラス
------------------------
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
return;
}
FarPoint.Web.Spread.HyperLinkCellType hl = new FarPoint.Web.Spread.HyperLinkCellType();
hl.CssClass = "myhl"; //CSSクラスを設定
hl.NavigateUrl = "https://dev.grapecity.co.jp/support/kb/";
FpSpread1.ActiveSheetView.Cells[1, 1].CellType = hl;
FpSpread1.ActiveSheetView.Cells[1, 1].Text = "FAQ";
}
-------------------------------
HTML
-------------------------------
※VBと同じです
Webフォームクラス
------------------------
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
return;
}
FarPoint.Web.Spread.HyperLinkCellType hl = new FarPoint.Web.Spread.HyperLinkCellType();
hl.CssClass = "myhl"; //CSSクラスを設定
hl.NavigateUrl = "https://dev.grapecity.co.jp/support/kb/";
FpSpread1.ActiveSheetView.Cells[1, 1].CellType = hl;
FpSpread1.ActiveSheetView.Cells[1, 1].Text = "FAQ";
}
-------------------------------
HTML
-------------------------------
※VBと同じです
キーワード
セル型