views:

1729

answers:

5

How do you implement autocomplete on ASP.Net Gridview? Can anyone point me where to go to achieve this? I'm willing to use non-.Net ajax controls if that what it takes.

A: 

The AJAX Control Toolkit provides an autocomplete but requires a web service to work. You could always write your own asmx if there isn't one you can use.

Otherwise, there are all sorts of JS and jQuery examples: http://www.javascript-examples.com/autocomplete-demo/

naspinski
+2  A: 

You will need to utilise an AJAX framework (JQuery is one i often recommend) which will provide the functionality to display the drop down box. You will then need to create a separate page (or web service) to return all the possible values to display in the auto-complete drop down.

To save on performance i recommend only initiating the auto-complete once the user has typed in 2 or 3 letters. These can then be passed by the JavaScript to the backed to proivde values to show in the drop down list.

The back end can communicate with the JavaScript using either simple CSV, JSON, XML Web service etc. See http://www.pengoworks.com/workshop/jquery/autocomplete.htm for examples.

Toby Mills
A: 

Thank you :).

Hanz
A: 

Refer link below

AutoComplete textbox in editItemTemplate of GridView

A: 

Scriptaculous has a nice autocomplete component. It is built on prototype.js.

I've used it to display an autocomplete list with formatted text and images etc. In that sense I think it is more flexible than the ASP.NET AJAX implementation.

Documentation http://wiki.github.com/madrobby/scriptaculous/ajax-autocompleter

Download http://script.aculo.us/downloads

George