リンクボタン型セル(コマンドボタン型セル)/ハイパーリンク型セルで折り返しを禁止したい
対象製品
SPREAD for .NET 2.5J Web Forms Edition
詳細
リンクボタン型セル(コマンドボタン型セル)/ハイパーリンク型セルにはテキスト型セルのAllowWrap プロパティのように折り返しを禁止する機能が用意されておりませんが、以下のようにスタイルシートを使用する方法があります。
【VB サンプルコード】
【C# サンプルコード】
【VB サンプルコード】
--------------------
Webフォームクラス
--------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If IsPostBack Then
Return
End If
Dim lb As New FarPoint.Web.Spread.ButtonCellType
lb.CommandName = "OneCommand"
lb.ButtonType = FarPoint.Web.Spread.ButtonType.LinkButton
lb.CssClass = "nowrap" 'CSSクラスを設定
lb.Text = "http://www.grapecity.com/てすと/"
FpSpread1.ActiveSheetView.Cells(0, 0).CellType = lb
Dim hl As New FarPoint.Web.Spread.HyperLinkCellType
hl.CssClass = "nowrap" 'CSSクラスを設定
hl.NavigateUrl = "http://www.grapecity.com/てすと/"
FpSpread1.Sheets(0).Cells(0, 1).CellType = hl
End Sub
--------------------
HTML
--------------------
<style type="text/css">
.nowrap a{white-space:nowrap;}
</style>
Webフォームクラス
--------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If IsPostBack Then
Return
End If
Dim lb As New FarPoint.Web.Spread.ButtonCellType
lb.CommandName = "OneCommand"
lb.ButtonType = FarPoint.Web.Spread.ButtonType.LinkButton
lb.CssClass = "nowrap" 'CSSクラスを設定
lb.Text = "http://www.grapecity.com/てすと/"
FpSpread1.ActiveSheetView.Cells(0, 0).CellType = lb
Dim hl As New FarPoint.Web.Spread.HyperLinkCellType
hl.CssClass = "nowrap" 'CSSクラスを設定
hl.NavigateUrl = "http://www.grapecity.com/てすと/"
FpSpread1.Sheets(0).Cells(0, 1).CellType = hl
End Sub
--------------------
HTML
--------------------
<style type="text/css">
.nowrap a{white-space:nowrap;}
</style>
【C# サンプルコード】
--------------------
Webフォームクラス
--------------------
private void Page_Load(object sender, System.EventArgs e)
{
if(Page.IsPostBack)
{
return;
}
FarPoint.Web.Spread.ButtonCellType lb = new FarPoint.Web.Spread.ButtonCellType();
lb.CommandName = "OneCommand";
lb.ButtonType = FarPoint.Web.Spread.ButtonType.LinkButton;
lb.CssClass = "nowrap"; //CSSクラスを設定
lb.Text = "http://www.grapecity.com/てすと/";
FpSpread1.ActiveSheetView.Cells[0,0].CellType = lb;
FarPoint.Web.Spread.HyperLinkCellType hl = new FarPoint.Web.Spread.HyperLinkCellType();
hl.CssClass = "nowrap"; //CSSクラスを設定
hl.NavigateUrl = "http://www.grapecity.com/てすと/";
FpSpread1.ActiveSheetView.Cells[0,1].CellType = hl;
}
--------------------
HTML
--------------------
VBのサンプルと同じです。
Webフォームクラス
--------------------
private void Page_Load(object sender, System.EventArgs e)
{
if(Page.IsPostBack)
{
return;
}
FarPoint.Web.Spread.ButtonCellType lb = new FarPoint.Web.Spread.ButtonCellType();
lb.CommandName = "OneCommand";
lb.ButtonType = FarPoint.Web.Spread.ButtonType.LinkButton;
lb.CssClass = "nowrap"; //CSSクラスを設定
lb.Text = "http://www.grapecity.com/てすと/";
FpSpread1.ActiveSheetView.Cells[0,0].CellType = lb;
FarPoint.Web.Spread.HyperLinkCellType hl = new FarPoint.Web.Spread.HyperLinkCellType();
hl.CssClass = "nowrap"; //CSSクラスを設定
hl.NavigateUrl = "http://www.grapecity.com/てすと/";
FpSpread1.ActiveSheetView.Cells[0,1].CellType = hl;
}
--------------------
HTML
--------------------
VBのサンプルと同じです。
この文書は、以前は次のFAQ IDで公開されていました : 10047