Spread for ASP.NET 7.0 Product Documentation
CompletionSetCount Property
See Also  Example Support Options
FarPoint.Web.Spread.Extender Assembly > FarPoint.Web.Spread.Extender Namespace > AutoCompleteCellType Class : CompletionSetCount Property


Glossary Item Box

Gets or sets the number of suggestions for completion.

Syntax

Visual Basic (Declaration) 
Public Property CompletionSetCount As Integer
Visual Basic (Usage)Copy Code
Dim instance As AutoCompleteCellType
Dim value As Integer
 
instance.CompletionSetCount = value
 
value = instance.CompletionSetCount
C# 
public int CompletionSetCount {get; set;}

Property Value

Integer number of suggestions

Example

This example uses a Web service for an automatic completion cell.
C#Copy Code
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.Extenders.Add(twe);
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 {
    
        [WebMethod]

  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()))
                filteredList.Add(name);
        }
        return (string[]) filteredList.ToArray(typeof(string));
  }
}
Visual BasicCopy Code
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.Extenders.Add(twe)
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

    <WebMethod()>
    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
                filteredList.Add(name)
            End If
        Next
        Return CType(filteredList.ToArray(GetType(System.String)), String())
    End Function

End Class

Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

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