.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Home >> Articles >> WPF >> Post New Resource Bookmark and Share   

 Subscribe to Articles

Autocomplete Box In WPF Toolkit

Posted By:Diptimaya Patra       Posted Date: May 06, 2010    Points: 25    Category: WPF    URL: http://www.dotnetspark.com  

Autocomplete Box In WPF Toolkit. In this article we will see how to use Autocomplete feature in our WPF application.


As you know WPF Toolkit has the recent version in February 2010, it has some controls added in Preview Brand. One of them is AutoCompleteBox. In this article we will see how to use it.

Creating WPF Application Project

Fire up Visual Studio 2008 and Create a WPF Application and name the project as AutoCompleteBoxInWPFToolkitSample.


Now we will add the AutoCompleteBox to our application. You can add it two ways, as you have recently uninstalled previous version of Toolkit and installed the new version, there will be occurrences where VisualStudio will through you error like the component doesn't exist.

So you need to add the Namespace "System.Windows.Controls.Input.Toolkit"


You can add it easily in Expression Blend as the following figure displays.


Now we will have some sample data to bind to the AutoCompleteBox.

public partial class Window1 : Window
    public Window1()
        List nameList = new List 
                "Albert Fernando", "Antonio Banderas", "Alex Mohane",
                "Barabara Moore", "Brad Pit", "Brenden Fraser",
                "Cameron Diaz", "Catherina Biel", "Christopher Ben",
                "Dan Gupta", "Diptimaya Patra", "Dhananjay Kumar",
                "Elizabeth Hurley", "Elisa Cuthbert", "Emma Bunton"

        acbName.ItemsSource = nameList;

That's it. Run the application and type in AutoCompleteBox. You will have the suggested list in the drop down.


And more importantly the fade in and fade out effect is added to the AutoCompleteBox.

You can also download the sample project used the above example.

Hope this article helps.

 Subscribe to Articles


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend