We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Simple Autocomplete Combo

Guys,
I am trying to decide the best way to implement a traditional dropdown list box with auto-complete. The items in the dropdown are determined when the page is displayed and don't change.

To be honest, what I want is essentially what the new tag would have done in HTML 5, but it got dropped.

So far it seems to me that:
1. I can't do auto-complete with your Generic DropDown

2. Can use the Autocomplete Textbox, but this only populates via another HTTP POST. I would like to be able send the data list down with the initial page render to cut out lots of subsequent posts. Is there a way I can to this?

Also, what do the DataFetch option do?

Cheers
Mark



1 Reply

ME Meena Syncfusion Team February 2, 2012 08:53 AM UTC

Hi Mark,

Thanks for using Syncfusion products.

Your requirement of sending the data list of AutoCompleteTextBox with the initial page without Http post could be achieved by enabling the DataSource property of the AutoCompleteTextBox. Please refer the below code snippet,


[Controller]
public ActionResult Index()
{
AutocompleteTextBoxModel myModel = new AutocompleteTextBoxModel();
Northwind context = SqlCE;
var dataSource = from suggestion in context.Customers
select suggestion.CustomerID;
myModel.DataSource = dataSource;
ViewData["myAutocomplete"] = myModel;
return View();
}


The DataSource property is used to fetch the data list without HttpPost.

ClientDataFetch is a feature of AutoComplete which is used to filter the data list from client side without any post.

We have created a simple sample with AutoComplete for your convenience and it can be downloaded from the below link.

AutoCompleteTextBox.zip

Please let us know if you have any other concerns.

Regards,
Meena



Loader.
Live Chat Icon For mobile
Up arrow icon