//
you're reading...
Silverlight 3

Applying Custom Filtering with AutoCompleteTextbox in Silverlight

Introduction: The AutoCompleteBox fuses a text entry with a drop-down list of suggestions. This feature is a common sight on the Web, powering everything from the search box on the Google homepage.

Silverlight’s auto complete textbox is pretty cool and more powerful to use, which have capabilities to for dynamic binding and other options.

So before we jump on advance options, let us start by building a basic auto complete textbox first.

Step 1: Create a Silverlight application and name it “AutoCompleteExample” or anything you like to

Step2: Drag AutoCompleteTextBox from toolbox to our main.xaml page. XAML for this should look like this.

<StackPanel>

<input:AutoCompleteBox x:Name=”txtCountry” IsTextCompletionEnabled=”True”  Height=”30″ Width=”200″ Margin=”10″ Padding=”3″                             HorizontalContentAlignment=”Center”></input:AutoCompleteBox>

</StackPanel>

Step3: In code behind, create a string array to keep country details;

string[] country = {“Australia” , “America”, “England”, “India”, “Pakistan”,”Nepal”,”South Africa”,

“Keyna”,”Iraq”,”Somalia”};

Step 4: Apply collection to autocompletetextbox itemsource property.

txtCountry.ItemsSource = country;

Step 5: Press F5 and type country name:

Advertisements

About Vishal

Vishal Nayan is a seasoned professional with hand on Experience on Mircrosoft Technologies. He always look for challenging IT position that allows him to learn new Microsoft Technologies while utilizing experience of Project Development and Software Engineering Ethics. A MCP in WCF ,and looking forward for more.

Discussion

2 thoughts on “Applying Custom Filtering with AutoCompleteTextbox in Silverlight

  1. Having read this I believed it was rather enlightening.
    I appreciate you taking the time and effort to put this information together.
    I once again find myself spending a significant amount of time
    both reading and commenting. But so what, it was
    still worth it!

    Posted by buy wiki links | 2012/07/14, 7:42 PM

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

Follow Vishalnayan on WordPress.com

Blog Stats

  • 214,547 hits
%d bloggers like this: