Spread Windows Forms 7.0 Product Documentation
MinimumValue Property
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.CellType Namespace > PercentCellType Class : MinimumValue Property


Glossary Item Box

Gets or sets the minimum value allowed for user entry.

Syntax

Visual Basic (Declaration) 
Public Property MinimumValue As Double
Visual Basic (Usage)Copy Code
Dim instance As PercentCellType
Dim value As Double
 
instance.MinimumValue = value
 
value = instance.MinimumValue
C# 
public double MinimumValue {get; set;}

Property Value

Double-precision, floating-point number representing the minimum value allowed in the cell

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.

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

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.

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

Example

This example creates a percent-formatted numeric cell and sets the various formatting properties.
C#Copy Code
FarPoint.Win.Spread.CellType.PercentCellType prctcell = new FarPoint.Win.Spread.CellType.PercentCellType();
prctcell.DecimalPlaces = 3;
prctcell.DecimalSeparator = ",";
prctcell.FixedPoint = true;
prctcell.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.UseRegional;
prctcell.MaximumValue = 50000.0;
prctcell.MinimumValue = -1000.0;
prctcell.NegativeFormat = FarPoint.Win.Spread.CellType.PercentNegativeFormat.PercentAfterWithSpace;
prctcell.NegativeRed = true;
prctcell.PercentSign = "%";
prctcell.PositiveFormat = FarPoint.Win.Spread.CellType.PercentPositiveFormat.PercentAfter;
prctcell.Separator = "/";
prctcell.ShowSeparator = true;
prctcell.SpinButton = true;
prctcell.SpinDecimalIncrement = 10;
prctcell.SpinIntegerIncrement = 5;
prctcell.SpinWrap = true;
fpSpread1.ActiveSheet.Cells[0, 0].CellType = prctcell;
fpSpread1.ActiveSheet.Cells[0, 0].Value = -443.0908;
Visual BasicCopy Code
Dim prctcell As New FarPoint.Win.Spread.CellType.PercentCellType()
prctcell.DecimalPlaces = 3
prctcell.DecimalSeparator = ","
prctcell.FixedPoint = True
prctcell.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.UseRegional
prctcell.MaximumValue = 50000.0
prctcell.MinimumValue = -1000.0
prctcell.NegativeFormat = FarPoint.Win.Spread.CellType.PercentNegativeFormat.PercentAfterWithSpace
prctcell.NegativeRed = True
prctcell.PercentSign = "%"
prctcell.PositiveFormat = FarPoint.Win.Spread.CellType.PercentPositiveFormat.PercentAfter
prctcell.Separator = "/"
prctcell.ShowSeparator = True
prctcell.SpinButton = True
prctcell.SpinDecimalIncrement = 10
prctcell.SpinIntegerIncrement = 5
prctcell.SpinWrap = True
FpSpread1.ActiveSheet.Cells(0, 0).CellType = prctcell
FpSpread1.ActiveSheet.Cells(0, 0).Value = -443.9098

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

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