Spread for ASP.NET 7.0 Product Documentation
NumberFormat Property
See Also  Example Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > IntegerCellType.EditModeSettings Class : NumberFormat Property


Glossary Item Box

Gets or sets a NumberFormatInfo that defines the format of an editing number.

Syntax

Visual Basic (Declaration) 
Public Property NumberFormat As NumberFormatInfo
Visual Basic (Usage)Copy Code
Dim instance As IntegerCellType.EditModeSettings
Dim value As NumberFormatInfo
 
instance.NumberFormat = value
 
value = instance.NumberFormat
C# 
public NumberFormatInfo NumberFormat {get; set;}

Remarks

If the EditMode property is set and the user enters edit mode in the cell, the value is displayed in the editor using the edit mode format. If the EditMode property is set and the user leaves edit mode in the cell, the value is converted to the display format if it is valid. If the EditMode property is not set, the display format is applied after the cell is updated (default behavior).

Example

This example sets a format for edit mode.
C#Copy Code
protected void Page_Load(object sender, System.EventArgs e)
{
if (this.IsPostBack) return;
FarPoint.Web.Spread.IntegerCellType ict = new FarPoint.Web.Spread.IntegerCellType();
ict.NumberFormat = new System.Globalization.NumberFormatInfo();
//Display mode, leave edit mode
ict.NumberFormat.NumberGroupSeparator = "?";
//Start edit mode
ict.EditMode.NumberFormat = new System.Globalization.NumberFormatInfo();
ict.EditMode.NumberFormat.NegativeSign = "~";
FpSpread1.Sheets[0].Columns[1].CellType = ict;
FpSpread1.Sheets[0].Cells[1, 1].Value = -34567;                           
}
VB.NETCopy Code
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If (IsPostBack) Then
    Return
End If
Dim ict As New FarPoint.Web.Spread.IntegerCellType()
ict.NumberFormat = New System.Globalization.NumberFormatInfo()
'Display mode, leave edit mode
ict.NumberFormat.NumberGroupSeparator = "?"
'Start edit mode
ict.EditMode.NumberFormat = New System.Globalization.NumberFormatInfo()
ict.EditMode.NumberFormat.NegativeSign = "~"
FpSpread1.Sheets(0).Columns(1).CellType = ict
FpSpread1.Sheets(0).Cells(1, 1).Value = -34567
End Sub

Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.