Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Additional functionality in AJAX AutoComplete Extender control

Reply
Thread Tools

Additional functionality in AJAX AutoComplete Extender control

 
 
jonefer
Guest
Posts: n/a
 
      06-14-2007
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.BasicPr ofile1_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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AJAX Autocomplete Extender problem Stefan Filip ASP .Net 2 08-28-2012 03:15 PM
Ajax Autocomplete Extender style Radu ASP .Net 0 10-09-2008 06:58 PM
Providing wait message for AJAX 3.5 AutoComplete extender JM_newsgroups ASP .Net 0 06-12-2008 01:28 PM
AutoComplete Extender Selection Event? GMartin ASP .Net 0 11-20-2006 10:02 PM
Enable autocomplete although site set autocomplete to off Frank Dohrmann Firefox 1 03-31-2006 11:28 PM



Advertisments