作成日: 2017/03/29 最終更新日: 2017/03/29
文書種別
使用方法
詳細
マスク型セルの正規表現を使って対応することができます。
次のサンプルでは整数部分を5桁、小数部分を3桁に制限します。
◎サンプルコード(VB)
◎サンプルコード(C#)
次のサンプルでは整数部分を5桁、小数部分を3桁に制限します。
◎サンプルコード(VB)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Page.IsPostBack Then
Return
End If
Dim mask As New FarPoint.Web.Spread.RegExpCellType()
mask.ValidationExpression = "¥d{0,5}¥.¥d{0,3}$|¥d{0,5}$"
FpSpread1.Sheets(0).Columns(0).CellType = mask
End Sub
If Page.IsPostBack Then
Return
End If
Dim mask As New FarPoint.Web.Spread.RegExpCellType()
mask.ValidationExpression = "¥d{0,5}¥.¥d{0,3}$|¥d{0,5}$"
FpSpread1.Sheets(0).Columns(0).CellType = mask
End Sub
◎サンプルコード(C#)
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
return;
}
FarPoint.Web.Spread.RegExpCellType mask = new FarPoint.Web.Spread.RegExpCellType();
mask.ValidationExpression = "¥¥d{0,5}¥¥.¥¥d{0,3}$|¥¥d{0,5}$";
FpSpread1.Sheets[0].Columns[0].CellType = mask;
}
{
if (Page.IsPostBack)
{
return;
}
FarPoint.Web.Spread.RegExpCellType mask = new FarPoint.Web.Spread.RegExpCellType();
mask.ValidationExpression = "¥¥d{0,5}¥¥.¥¥d{0,3}$|¥¥d{0,5}$";
FpSpread1.Sheets[0].Columns[0].CellType = mask;
}
旧文書番号
40230