Article Posted: AutoCompleteComboBox for Silverlight

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.

5 Responses to “Article Posted: AutoCompleteComboBox for Silverlight”

  1. uberVU - social comments Says:

    Social comments and analytics for this post…

    This post was mentioned on Twitter by SilverlightNews: AutoCompleteComboBox for Silverlight – http://snurl.com/ua2i1...

  2. Все о Microsoft Silverlight » Автозаполняемый ComboBox для Silverlight Says:

    [...] Собственно пример простого автозаполнения. Статья. [...]

  3. DotNetShoutout Says:

    AutoCompleteComboBox for Silverlight « Mehroz’s Experiments…

    Thank you for submitting this cool story – Trackback from DotNetShoutout…

  4. Jandos Says:

    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.

  5. Syed Mehroz Alam Says:

    Jandos,

    You can try uploading your app to skydrive.


Leave a Reply