Spread ASP.NET 14
FarPoint.Web.Spread.Extender Assembly / FarPoint.Web.Spread.Extender Namespace / AutoCompleteCellType Class / MinimumPrefixLength Property

In This Topic
    MinimumPrefixLength Property
    In This Topic
    Gets or sets the minimum length of text before the Web service provides suggestions for completion.
    Public Property MinimumPrefixLength As Integer
    Dim instance As AutoCompleteCellType
    Dim value As Integer
    instance.MinimumPrefixLength = value
    value = instance.MinimumPrefixLength
    public int MinimumPrefixLength {get; set;}

    Property Value

    Integer number of characters in the minimum length of text
    This example uses a Web service for an automatic completion cell.
    FarPoint.Web.Spread.Extender.AutoCompleteCellType ac = new FarPoint.Web.Spread.Extender.AutoCompleteCellType();
    ac.BackgroundImageUrl = null;
    ac.CompletionInterval = 1000;
    ac.CompletionSetCount = 5;
    ac.DelimiterCharacters = ";, :";
    AjaxControlToolkit.TextBoxWatermarkExtender twe = new AjaxControlToolkit.TextBoxWatermarkExtender();
    twe.WatermarkText = "Type a character";
    ac.ServicePath = "WebService.asmx";
    ac.ServiceMethod = "GetAllNames";
    ac.MinimumPrefixLength = 1;
    ac.EnableCaching = true;
    ac.ShowEditor = true;
    FpSpread1.ActiveSheetView.Cells[0, 0].CellType = ac;
    public class WebService : System.Web.Services.WebService {
      public  string[] GetAllNames(string prefixText, int count)
            ArrayList filteredList = new ArrayList();
            string[] names = {"AzamSharp","Scott","Alex","Mary","John","Ali","Sam","Sammy"};
            foreach (string name in names)
                    if (name.ToLower().StartsWith(prefixText.ToLower()))
            return (string[]) filteredList.ToArray(typeof(string));
    Dim ac As New FarPoint.Web.Spread.Extender.AutoCompleteCellType
    ac.BackgroundImageUrl = Nothing
    ac.CompletionInterval = 1000
    ac.CompletionSetCount = 5
    ac.DelimiterCharacters = ";, :"
    Dim twe As New AjaxControlToolkit.TextBoxWatermarkExtender
    twe.WatermarkText = "Type a character"
    ac.ServicePath = "WebService.asmx"
    ac.ServiceMethod = "GetAllNames"
    ac.MinimumPrefixLength = 1
    ac.EnableCaching = True
    ac.ShowEditor = True
    FpSpread1.ActiveSheetView.Cells(0, 0).CellType = ac
    Public Class WebService
         Inherits System.Web.Services.WebService
        Public Function GetAllNames(ByVal prefixText As String, ByVal count As Integer) As String()
            Dim filteredList As ArrayList = New ArrayList
            Dim names() As String = {"AzamSharp", "Scott", "Alex", "Mary", "John", "Ali", "Sam", "Sammy"}
            For Each name As String In names
                If name.ToLower.StartsWith(prefixText.ToLower) Then
                End If
            Return CType(filteredList.ToArray(GetType(System.String)), String())
        End Function
    End Class
    See Also