Spread Windows Forms 11.0 Product Documentation
Candidates Property (ExcludeListValidator)
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > ExcludeListValidator Class : Candidates Property
Gets or sets a System.String array that indicates the specified value that is excluded in the candidate strings.
Syntax
'Declaration
 
Public Property Candidates As String()
'Usage
 
Dim instance As ExcludeListValidator
Dim value() As String
 
instance.Candidates = value
 
value = instance.Candidates
public string[] Candidates {get; set;}

Property Value

A System.String array that indicates the candidate strings. The default is a null reference (Nothing in Visual Basic).
Example
This example uses the exclude list validation.
//Type one of the candidate items in cell 1,1 to see the error notification
FarPoint.Win.Spread.CellStyleNotify cnotify = new FarPoint.Win.Spread.CellStyleNotify();
cnotify.InvalidCellStyle.BackColor = Color.Bisque;
FarPoint.Win.Spread.ExcludeListValidator excludelist = new FarPoint.Win.Spread.ExcludeListValidator();
excludelist.Candidates = new string[] { "Bird", "Deer", "Squirrel", "Lizard" };
excludelist.Actions.Add(cnotify);
fpSpread1.Sheets[0].AddValidators(new FarPoint.Win.Spread.Model.CellRange(1, 1, 1, 1), excludelist);
'Type one of the candidate items in cell 1,1 to see the error notification
Dim cnotify As New FarPoint.Win.Spread.CellStyleNotify()
cnotify.InvalidCellStyle.BackColor = Color.Bisque
Dim excludelist As New FarPoint.Win.Spread.ExcludeListValidator()
excludelist.Candidates = New String() {"Bird", "Deer", "Squirrel", "Lizard"}
excludelist.Actions.Add(cnotify)
FpSpread1.Sheets(0).AddValidators(New FarPoint.Win.Spread.Model.CellRange(1, 1, 1, 1), excludelist)
See Also

Reference

ExcludeListValidator Class
ExcludeListValidator Members