Additional functionality in AJAX AutoComplete Extender control

Discussion in 'ASP .Net Web Controls' started by jonefer, Jun 14, 2007.

  1. jonefer

    jonefer Guest

    Is there a way to place column headers in the AutoCompleteExtender control?

    I'd like to eventually add more functionality, such as adding more columns
    and setting the width of those columns, but I wonder if it is possible to set
    those properties.

    My webservice function is as follows for one column:

    Imports System.Web
    Imports System.Web.Services
    Imports System.Web.Services.Protocols
    Imports System.Data
    Imports System.Data.SqlClient
    Imports System.Collections.Generic

    <WebService(Namespace:="http://tempuri.org/")> _
    <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
    <System.Web.Script.Services.ScriptService()> _
    Public Class autocomplete
    Inherits System.Web.Services.WebService

    <WebMethod()> _
    Public Function GetSuggestionsFromDataset(ByVal prefixText As String,
    ByVal count As Integer) As String()
    ' Define data set
    Dim ds As New DataSet()
    Dim dt As New DataTable()
    Dim dr As SqlDataReader = PurchasingBLL.GetCostCenters
    Dim da As New PurchasingTableAdapters.tbl_CostCenterTableAdapter
    ds.Tables.Add(dt)

    dt.Columns.Add(New DataColumn("Word", GetType(String)))

    dt.Rows.Add("Cost Center")
    Do While dr.Read
    dt.Rows.Add(New ListItem(dr("FullCCNum")))
    Loop


    Dim suggestions As New List(Of String)()

    Dim words As DataRow() = dt.[Select]("Word LIKE '" + prefixText +
    "%'")

    Dim num As Integer = IIf((words.Length < count), words.Length, count)
    For i As Integer = 0 To num - 1
    suggestions.Add(DirectCast(words(i)("Word"), String))
    Next
    Return suggestions.ToArray()
    End Function

    End Class
    jonefer, Jun 14, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. GMartin
    Replies:
    0
    Views:
    383
    GMartin
    Nov 20, 2006
  2. =?Utf-8?B?Ym9iYnk=?=

    AutoComplete extender

    =?Utf-8?B?Ym9iYnk=?=, Sep 13, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    648
    densial
    Sep 13, 2007
  3. Stefan Filip

    AJAX Autocomplete Extender problem

    Stefan Filip, Nov 21, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    5,227
    yuriy.loginov
    Aug 28, 2012
  4. JM_newsgroups
    Replies:
    0
    Views:
    676
    JM_newsgroups
    Jun 12, 2008
  5. Radu

    Ajax Autocomplete Extender style

    Radu, Oct 9, 2008, in forum: ASP .Net
    Replies:
    0
    Views:
    3,479
Loading...

Share This Page