Spread Windows Forms 8.0 Product Documentation
MinimumValue Property (CurrencyCellType)
Example 


Gets or sets the minimum value allowed for user entry.
Syntax
'Declaration
 
Public Property MinimumValue As Decimal
'Usage
 
Dim instance As CurrencyCellType
Dim value As Decimal
 
instance.MinimumValue = value
 
value = instance.MinimumValue
public decimal MinimumValue {get; set;}

Property Value

Decimal numeric value for the minimum value
Exceptions
ExceptionDescription
System.ArgumentOutOfRangeException Specified value is beyond accepted limits
Remarks

The MinimumValue and MaximumValue properties limit the value that the user enters when editing the cell. It does not affect the data model and does not the limit the cell getting a value by other means, for example by means of a formula.

Use the MinimumValue and MaximumValue properties to place range restrictions on user entry. For example the following code limits user input to values between 0 and 100.

CurrencyCellType cct = new CurrencyCellType();
cct.MinimumValue = 0.0;
cct.MaximumValue = 100.0;
spread.Sheets[0].Cells[0,0].CellType = cct;


Use the MIN and MAX functions to place range restrictions on formula calculations. For example, the following code limits the summation calculation to values between 0 and 100.

fpspread1.Sheets[0].Cells[4,0].Formula = "MAX(0, MIN(SUM(A1:A4), 100))";

Example
This example specifies a currency cell and sets the formatting using the various properties.
FarPoint.Win.Spread.CellType.CurrencyCellType currcell = new FarPoint.Win.Spread.CellType.CurrencyCellType();
currcell.CurrencySymbol = "CN$";
currcell.DecimalPlaces = 4;
currcell.DecimalSeparator = "#";
currcell.FixedPoint = true;
currcell.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.Yes;
currcell.MaximumValue = 999999999999;
currcell.MinimumValue = 1;
currcell.NegativeFormat = FarPoint.Win.Spread.CellType.CurrencyNegativeFormat.SignSymbolSpaceBefore;
currcell.NegativeRed = true;
currcell.PositiveFormat = FarPoint.Win.Spread.CellType.CurrencyPositiveFormat.CurrencySymbolBefore;
currcell.Separator = ",";
currcell.ShowCurrencySymbol = true;
currcell.ShowSeparator = true;
fpSpread1.Sheets[0].Cells[5,2].CellType = currcell;
fpSpread1.Sheets[0].Cells[5,2].Value = 321.98;
Dim currcell As New FarPoint.Win.Spread.CellType.CurrencyCellType()
currcell.CurrencySymbol = "CN$"
currcell.DecimalPlaces = 4
currcell.DecimalSeparator = "#"
currcell.FixedPoint = True
currcell.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.Yes
currcell.MaximumValue = 999999999999
currcell.MinimumValue = 1
currcell.NegativeFormat = FarPoint.Win.Spread.CellType.CurrencyNegativeFormat.SignSymbolSpaceBefore
currcell.NegativeRed = true
currcell.PositiveFormat = FarPoint.Win.Spread.CellType.CurrencyPositiveFormat.CurrencySymbolBefore
currcell.Separator = ","
currcell.ShowCurrencySymbol = True
currcell.ShowSeparator = True
FpSpread1.Sheets(0).Cells(5, 2).CellType = currcell
FpSpread1.Sheets(0).Cells(5, 2).Value = 443.3482
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

Reference

CurrencyCellType Class
CurrencyCellType Members

 

 


Copyright © GrapeCity, inc. All rights reserved.