I have posted an article at CodeProject on customization of the Silverlight AutoCompleteBox to be used as a type-ahead ComboBox in LOB applications at CodeProject. The AutoCompleteComboBox can be used in typical Object-to-Object associations (one that we typically encounter when creating associations in Entity Framework) as well as Foreign Key associations (the new association type introduced with Entity Framework 4).
Here’s a sample usage of the control in a typical MVVM scenario:
- Object to Object Association:
Example data structure:
public class SalesOrderDetail { Product product; public Product Product { get { return product; } set { product = value; } } }Example control usage:
<custom:AutoCompleteComboBox SelectedItemBinding="{Binding Product, Mode=TwoWay}" ItemsSource="{Binding Path=Products, Source={StaticResource ViewModel}}" /> - Foreign Key Association:
Example data structure:
public class SalesOrderDetail { int productID; public int ProductID { get { return productID; } set { productID = value; } } }Example control usage:
<custom:AutoCompleteComboBox SelectedValue="{Binding ProductID, Mode=TwoWay}" SelectedValuePath="ProductID" ItemsSource="{Binding Path=Products, Source={StaticResource ViewModel}}" />
To view the implementation details, you can read the full article at :
http://www.codeproject.com/KB/silverlight/AutoComplete_ComboBox.aspx
The source code along with a demo project can be downloaded from the article as well as here (28 KB). Remember to rename the file as zip for extraction.

February 6, 2010 at 6:03 AM
Social comments and analytics for this post…
This post was mentioned on Twitter by SilverlightNews: AutoCompleteComboBox for Silverlight – http://snurl.com/ua2i1...
February 11, 2010 at 11:14 AM
[...] Собственно пример простого автозаполнения. Статья. [...]
February 16, 2010 at 5:44 PM
AutoCompleteComboBox for Silverlight « Mehroz’s Experiments…
Thank you for submitting this cool story – Trackback from DotNetShoutout…
June 23, 2010 at 5:37 AM
I have a problem with using AutoCompleteComboBox. In two way binding mode, after setting datacontext to a new domain object instance, autocompletecombobox reverts to previous instance’s value. I have built small app to show this. Where can I upload it? Thank you.
June 23, 2010 at 5:25 PM
Jandos,
You can try uploading your app to skydrive.