PowerTools SPREAD for ASP.NET 8.0J パフォーマンスガイドライン
編集可能なセル型

シート上での編集が可能なセル型として8種類のセルが提供されています。各セルで提供される機能はそれぞれ異なるものですが、出力されるタグの構成に大きな違いはありません。これはセルを編集した時に表示される編集用コントロールは、tdタグとは別の箇所で定義されていることによるものです。

1. 標準型セル

実装コード

FarPoint.Web.Spread.GeneralCellType gen = new FarPoint.Web.Spread.GeneralCellType();
FpSpread1.ActiveSheetView.Cells[0, 0].CellType = gen;
FpSpread1.ActiveSheetView.SetValue(0, 0, "abc");
Dim gen As New FarPoint.Web.Spread.GeneralCellType()
FpSpread1.ActiveSheetView.Cells(0, 0).CellType = gen
FpSpread1.ActiveSheetView.SetValue(0, 0, "abc")

出力タグ

バイト数:83

<td class="s0s2" FpCellType="GeneralCellType" FpEditorID="FpSpread1_ctl02">abc</td>
2. テキスト型セル

実装コード

FarPoint.Web.Spread.TextCellType text = new FarPoint.Web.Spread.TextCellType();
FpSpread1.ActiveSheetView.Cells[0, 0].CellType = text;
FpSpread1.ActiveSheetView.SetValue(0, 0, "abc");
Dim text As New FarPoint.Web.Spread.TextCellType()
FpSpread1.ActiveSheetView.Cells(0, 0).CellType = text
FpSpread1.ActiveSheetView.SetValue(0, 0, "abc")

出力タグ

バイト数:52

<td class="s0s2" FpRef="FpSpread1_FpRef0r0">abc</td>
3. 日付時刻型セル

実装コード

FarPoint.Web.Spread.DateTimeCellType dt = new FarPoint.Web.Spread.DateTimeCellType();
FpSpread1.ActiveSheetView.Cells[0, 0].CellType = dt;
FpSpread1.ActiveSheetView.SetValue(0, 0, New DateTime(2016, 4, 1));
Dim dt As New FarPoint.Web.Spread.DateTimeCellType()
FpSpread1.ActiveSheetView.Cells(0, 0).CellType = dt
FpSpread1.ActiveSheetView.SetValue(0, 0, New DateTime(2016, 4, 1))

出力タグ

バイト数:144

<td class="s0s2" align="left" CellType2="DateTimeCellType" FpEditorID="FpSpread1_ctl02" style="white-space:nowrap;"><nobr>2016/04/01</nobr></td>

 

4. 整数型セル

実装コード

FarPoint.Web.Spread.IntegerCellType intcell = new FarPoint.Web.Spread.IntegerCellType();
FpSpread1.ActiveSheetView.Columns[0, 0].CellType = intcell;
FpSpread1.ActiveSheetView.SetValue(0, 0, 123);
Dim intcell As New FarPoint.Web.Spread.IntegerCellType()
FpSpread1.ActiveSheetView.Columns(0, 0).CellType = intcell
FpSpread1.ActiveSheetView.SetValue(0, 0, 123)

出力タグ

バイト数:107

<td class="s0s2" align="right" FpRef="FpSpread1_FpRef0r0" style="white-space:nowrap;"><nobr>123</nobr></td>
5. 倍精度型セル

実装コード

FarPoint.Web.Spread.DoubleCellType dblcell = new FarPoint.Web.Spread.DoubleCellType();
FpSpread1.ActiveSheetView.Cells[0, 0].CellType = dblcell;
FpSpread1.ActiveSheetView.SetValue(0, 0, 12.3);
Dim dblcell As New FarPoint.Web.Spread.DoubleCellType()
FpSpread1.ActiveSheetView.Cells(0, 0).CellType = dblcell
FpSpread1.ActiveSheetView.SetValue(0, 0, 12.3)

出力タグ

バイト数:108

<td class="s0s2" align="right" FpRef="FpSpread1_FpRef0r0" style="white-space:nowrap;"><nobr>12.3</nobr></td>
6. 通貨型セル

実装コード

FarPoint.Web.Spread.CurrencyCellType currcell = new FarPoint.Web.Spread.CurrencyCellType();
FpSpread1.ActiveSheetView.Cells[0, 0].CellType = currcell;
FpSpread1.ActiveSheetView.SetValue(0, 0, 123);
Dim currcell As New FarPoint.Web.Spread.CurrencyCellType()
FpSpread1.ActiveSheetView.Cells(0, 0).CellType = currcell
FpSpread1.ActiveSheetView.SetValue(0, 0, 123)

出力タグ

バイト数:113

<td class="s0s2" align="right" FpRef="FpSpread1_FpRef0r0" style="white-space:nowrap;"><nobr>&#165;123</nobr></td>
7. パーセント型セル

実装コード

FarPoint.Web.Spread.PercentCellType pctcell = new FarPoint.Web.Spread.PercentCellType();
FpSpread1.ActiveSheetView.Cells[0, 0].CellType = pctcell;
FpSpread1.ActiveSheetView.SetValue(0, 0, 0.12);
Dim pctcell As New FarPoint.Web.Spread.PercentCellType()
FpSpread1.ActiveSheetView.Cells(0, 0).CellType = pctcell
FpSpread1.ActiveSheetView.SetValue(0, 0, 0.12)

出力タグ

バイト数:107

<td class="s0s2" align="right" FpRef="FpSpread1_FpRef0r0" style="white-space:nowrap;"><nobr>12%</nobr></td>
8. マスク型セル

実装コード

FarPoint.Web.Spread.RegExpCellType rgex = new FarPoint.Web.Spread.RegExpCellType();
rgex.ValidationExpression = "^\\d{3}-\\d{2}-\\d{4}$";
rgex.ErrorMessage = "書式が異なります";
FpSpread1.ActiveSheetView.Cells[0, 0].CellType = rgex;
FpSpread1.ActiveSheetView.SetValue(0, 0, "123-45-6789");
Dim rgex As New FarPoint.Web.Spread.RegExpCellType()
rgex.ValidationExpression = "^\d{3}-\d{2}-\d{4}$"
rgex.ErrorMessage = "書式が異なります"
FpSpread1.ActiveSheetView.Cells(0, 0).CellType = rgex
FpSpread1.ActiveSheetView.SetValue(0, 0, "123-45-6789")

出力タグ

バイト数:101

<td class="s0s2" FpRef="FpSpread1_FpRef0r0" style="white-space:nowrap;"><nobr>123-45-6789</nobr></td>
関連トピック

 

 


Copyright © 2003-2015 GrapeCity inc. All rights reserved.