Spread Windows Forms 13.0 Product Documentation
GrapeCity.Win.PluginInputMan Assembly / GrapeCity.Win.Spread.InputMan.CellType Namespace / GcTextBoxCellType Class / AutoCompleteCustomSource Property
Example


In This Topic
    AutoCompleteCustomSource Property (GcTextBoxCellType)
    In This Topic
    Gets or sets a custom System.Windows.Forms.AutoCompleteStringCollection to use when the GcTextBox.AutoCompleteSource property is set to CustomSource.
    Syntax
    'Declaration
     
    Public Property AutoCompleteCustomSource As AutoCompleteStringCollection
    'Usage
     
    Dim instance As GcTextBoxCellType
    Dim value As AutoCompleteStringCollection
     
    instance.AutoCompleteCustomSource = value
     
    value = instance.AutoCompleteCustomSource
    public AutoCompleteStringCollection AutoCompleteCustomSource {get; set;}

    Property Value

    A System.Windows.Forms.AutoCompleteStringCollection to use with GcTextBox.AutoCompleteSource.
    The default is a null reference (Nothing in Visual Basic).
    Remarks
    Use the AutoCompleteCustomSource, GcTextBox.AutoCompleteMode, and AutoCompleteSource properties to create a GcTextBox that automatically completes the input string by comparing the prefix being entered to the prefixes of all strings in a maintained source. This is useful for TextBox controls in which URLs, addresses, file names, or commands are frequently entered.

    The use of the AutoCompleteCustomSource property is optional, but you must set the AutoCompleteSource property to CustomSource in order to use AutoCompleteCustomSource.

    You must use the AutoCompleteMode and AutoCompleteSource properties together.

    Example
    This example uses the AutoCompleteCustomSource property.
    GrapeCity.Win.Spread.InputMan.CellType.GcTextBoxCellType inputcell1 = new GrapeCity.Win.Spread.InputMan.CellType.GcTextBoxCellType();
    inputcell1.AcceptsArrowKeys = FarPoint.Win.SuperEdit.AcceptsArrowKeys.AllArrows;            
    inputcell1.DisplayAlignment = GrapeCity.Win.Spread.InputMan.CellType.DisplayAlignment.Distributed;
    AutoCompleteStringCollection acsc = new AutoCompleteStringCollection();
    acsc.AddRange(new string[] { "One", "Two", "Three", "Four" });
    inputcell1.AutoCompleteCustomSource  = acsc;
    inputcell1.AutoCompleteMode = AutoCompleteMode.Suggest;
    inputcell1.AutoCompleteSource = AutoCompleteSource.CustomSource;
    fpSpread1.Sheets[0].Cells[1, 1].CellType = inputcell1;
    Dim inputcell1 As New GrapeCity.Win.Spread.InputMan.CellType.GcTextBoxCellType
    inputcell1.AcceptsArrowKeys = FarPoint.Win.SuperEdit.AcceptsArrowKeys.AllArrows
    inputcell1.DisplayAlignment = GrapeCity.Win.Spread.InputMan.CellType.DisplayAlignment.Distributed
    Dim acsc As New AutoCompleteStringCollection
    acsc.AddRange(New String() {"One", "Two", "Three", "Four"})
    inputcell1.AutoCompleteCustomSource = acsc
    inputcell1.AutoCompleteMode = AutoCompleteMode.Suggest
    inputcell1.AutoCompleteSource = AutoCompleteSource.CustomSource
    fpSpread1.Sheets(0).Cells(1, 1).CellType = inputcell1
    See Also