private void Form1_Load(object sender, EventArgs e)
{
// セル型の自動設定を無効
fpSpread1.ActiveSheet.DataAutoCellTypes = false;
// 数値型セルの設定
FarPoint.Win.Spread.CellType.NumberCellType nc = new FarPoint.Win.Spread.CellType.NumberCellType();
nc.MaximumValue = 9999999.99;
nc.MinimumValue = -9999999.99;
fpSpread1.ActiveSheet.Columns[0].CellType = nc;
// テストデータの設定
DataTable dt = new DataTable("TEST");
dt.Columns.Add("ColumnA", typeof(double)); dt.Rows.Add(123.4);
dt.Rows.Add(1234.5);
dt.AcceptChanges();
fpSpread1.ActiveSheet.DataSource = dt;
// MaximumValue/MinimumValueの確認
FarPoint.Win.Spread.CellType.NumberCellType checknc = (FarPoint.Win.Spread.CellType.NumberCellType)fpSpread1.ActiveSheet.GetCellType(0, 0);
Console.WriteLine(checknc.MaximumValue);
Console.WriteLine(checknc.MinimumValue);
}
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' セル型の自動設定を無効
FpSpread1.ActiveSheet.DataAutoCellTypes = False
' 数値型セルの設定
Dim nc As New FarPoint.Win.Spread.CellType.NumberCellType()
nc.MaximumValue = 9999999.99
nc.MinimumValue = -9999999.99
FpSpread1.ActiveSheet.Columns(0).CellType = nc
' テストデータの設定
Dim dt As New DataTable("TEST")
dt.Columns.Add("ColumnA", GetType(Double))
dt.Rows.Add(123.4)
dt.Rows.Add(1234.5)
dt.AcceptChanges()
FpSpread1.ActiveSheet.DataSource = dt
' MaximumValue/MinimumValueの確認
Dim checknc As FarPoint.Win.Spread.CellType.NumberCellType = FpSpread1.ActiveSheet.GetCellType(0, 0)
Console.WriteLine(checknc.MaximumValue)
Console.WriteLine(checknc.MinimumValue)
End Sub