Spread Windows Forms 13.0 Product Documentation
FarPoint.Win.Spread Assembly / FarPoint.Win.Spread Namespace / IncludeListValidator Class / Candidates Property

In This Topic
    Candidates Property (IncludeListValidator)
    In This Topic
    Gets or sets a System.String array that indicates the specified values included in the candidate strings.
    Public Property Candidates As String()
    Dim instance As IncludeListValidator
    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).
    This example creates a validator with a list of valid items.
    //Type an item in cell 1,1 that is not in the list to see the error notification
    FarPoint.Win.Spread.CellStyleNotify cnotify = new FarPoint.Win.Spread.CellStyleNotify();
    cnotify.InvalidCellStyle.BackColor = Color.Yellow;
    FarPoint.Win.Spread.IncludeListValidator ilist = new FarPoint.Win.Spread.IncludeListValidator();
    ilist.Candidates = new string[] { "Bird", "Deer", "Squirrel", "Lizard" };           
    fpSpread1.Sheets[0].AddValidators(new FarPoint.Win.Spread.Model.CellRange(1, 1, 1, 1), ilist);
    'Type an item in cell 1,1 that is not in the list to see the error notification
    Dim cnotify As New FarPoint.Win.Spread.CellStyleNotify()
    cnotify.InvalidCellStyle.BackColor = Color.Yellow
    Dim IList As New FarPoint.Win.Spread.IncludeListValidator()
    IList.Candidates = New String() {"Bird", "Deer", "Squirrel", "Lizard"}
    FpSpread1.Sheets(0).AddValidators(New FarPoint.Win.Spread.Model.CellRange(1, 1, 1, 1), IList)
    See Also