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

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

How to implement AutoComplete TextBox in WPF?

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :JQuery


I am new to WPF Environment.How implement a textbox when i type a letter automatically give suggestions.

ie when i type 'A' A related words will come.

How to do?



View Complete Post

More Related Resource Links

textbox AutoComplete not work in XP and missing data

When I use the application in XP, auto complete mssing some data~ Here is some of data, IRC-3100 IRC-3200 IRC-5180 when I type "IRC" in the textbox, the fellow didn't show and when I type "IRC-", only IRC-3100 show this issues only occur in XP and window 7 is OK. I don't know why, please help here us the code I use to add autocomplete source~   AutoCompleteStringCollection collection = new AutoCompleteStringCollection();   PropertyInfo ppty = typeof(SOURCE).GetProperty(displayProperty);   foreach (SOURCE s in sources) {   collection.Add(value.ToString()); }   else { collection.Add( string.Empty); } } box.AutoCompleteCustomSource = collection; box.AutoCompleteSource = AutoCompleteSource.CustomSource; box.AutoCompleteMode = AutoCompleteMode.Suggest;        ClarkC

Autocomplete textbox in sharepoint

I want to develop usercontrol web part for auto complete textbox. As per the requirement, I can't use AJAX extender control. Suggest me , how I can do that.

autocomplete combobox/textbox binding to dataset


Hi All.

I found sample http://www.codeproject.com/KB/WPF/WPFAutoCompleteTextbox.aspxAutoComplete ComboBox where data is hardcoded in the code. I would like to use AutoComplete ComboBox binded to dataset. I don't have a problem binding data to ComboBox but I have problem if need that combobox autocomplete and filtered listbox. That is bit of code which I found

  Public Sub New()

    textBox1.AddItem(New AutoCompleteEntry("Toyota Camry", "Toyota Camry", "camry", "car", "sedan"))
    textBox1.AddItem(New AutoCompleteEntry("Toyota Corolla", "Toyota Corolla", 

Textbox and AutoComplete Extender problem


I have a textbox which takes data from autocomplete.

I want to check the textbox text and if the text wasn't taken from autocomplete extender, I want to clear the text.

How can I do this ?


Set dropdown width of a textbox with AutoComplete in windows forms



I have used a Textbox control along with its AutoComplete feature by using AutoCompleteMode,AutoCompleteSource and AutoCompleteCustomSource properties.

Everything is working fine i.e. on typing letters dropdown list shows the related matching list of values.

However, I am not able to set the size of dropdown list programmatically.  I can increase the size(preferably width) of dropdown list at runtime.  But, as AutoCompleteCustomSource is getting reset everytime the textbox gets focused, dropdown list width also gets reset to the width of the textbox.

Just like the feature of Combo to set DropDownWidth programmatically (or say at design time), is there any way to set dropdown width for a Textbox having AutoComplete feature.

My Code for the reference (On Form Load event) :

        TextBox1.AutoCompleteMode = AutoCompleteMode.Suggest

Dynamic Filling of TextBox AutoComplete not working


Hi guys,


i would like to fill the textbox autocomplete stringcollection "on the fly" while typing. i don't want to fill the collection while initializing, 'cause it's too much data: the sql server-table has about 100.000+ rows. the filling takes too much time and the "autocomplete-popup-find-something-box" itself is getting too slow, too.

my configuration:
.NET-Framework: 2.0.50727, System.Windows.Forms.TextBox

TextBox-Properties: AutoCompleteSource: CustomSource; AutoCompleteMode: Suggest

i tried several different things...

1. i did put this code in the "TextChanged"-event, but i think it's 'too late' there:

private void

Incorrect TextBox autocomplete suggestions



I have something that looks like a TextBox bug. It appears when TextBox shows autocomplete suggestions for items which contain dashes "-".

Here is my autocomplete source:




I set it on the property panel. Designer code:

Me.TextBox2.AutoCompleteCustomSource.AddRange(New String() {"34534535345", "-", "----", "11-g", "11--g", "--11j", "1g-", "1gf-asd871-hdaksu", "1gg-", "1-g-o-p-a", 

AutoComplete textbox and combobox not working


I am using a textbox and when I provide custom source from collection at design time it works but when i use custom source in code and fill data from a datatable it doesnot works.

Here is the code ...


 Dim dt As New DataTable
        dt = DataClass.getList("select cust_name from Customer").Table

        Dim cs As New AutoCompleteStringCollection
        For Each r As DataRow In dt.Rows

        TextBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend
        TextBox1.AutoCompleteSource = AutoCompleteSource.CustomSource
        TextBox1.AutoCompleteCustomSource = cs




how to use autocomplete in Textbox using LINQ code


Hi Everyone!


I'm a newbie in C# then i want to know about my concerns in textbox autocomplete from database using LINQ. Can u cite me an example on how to code it and where should I place it? Is it in Form_Load or Textbox_TextChange?


Tnx man and more power!

how to filtering the autocomplete textbox values while selecting perticuler value in dropdown.


in my applicaion dropdown having country,state ,district  values  and one autocomplete textbox  , if i select country in the dropdown  only country names should be filtering in autocomplete textbox ..........can anybody tell me

thanks in advance


Autocomplete textbox with ajax and sql database



    <form id="form1" runat="server">
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
                <asp:ServiceReference Path="~/WebService.asmx"/>
        <asp:TextBox ID="TextBox1" runat="server" autocomplete="off"></asp:TextBox>              

        <asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" 
            ShowOnlyCurrentWordInCompletionListItem="true" >


i am using the same thing and till my webservice is concern, that is bringing up the value from table but when i am typing on the textbox so it not showiing suggestion like a google... i debug my web service that is fine working...

can anyone tell m where i am doing wrong???? plz he

Textbox Editable GridView in ASP.NET

This article describes how I made a fully editable gridview in C# using ASP.NET 2. The idea is that the GridView looks and works like an Excel spreadsheet. You see all the cells in the table, and you can edit any of the cells you like, and they are automatically updated (i.e. saved to the database). This is very often how people expect data tables to work in web pages, and I've often seen people clicking in vain on un-editable gridview cells, somehow expecting to edit them, and not understanding that they need to click an Edit button at the end of the row.

Highlighting Rows with TextBox OnFocus

In another article I explained that how you can make the rows of the GridView control clickable and highlight them when they are clicked. In this article I will explain that how you can highlight the GridView rows when you focus on the TextBox which is contained inside the GridView control.

Custom Editing Behavior for DataGridView TextBox Columns

For various reasons I'm using a DataGridView instead of a ListView, and while configuring the DataGridView to look like a ListView wasn't much of a problem, there's one thing that got on my nerves, which is the behavior of textbox cells in edit mode: It is much too easy to leave the edit mode accidentally, simply by pressing the cursor keys at the wrong time. For example when the text caret is positioned behind the last character of the textbox cell content, and you press the right arrow key

Editable Gridview with Textbox, CheckBox, Radio Button and DropDown List

This is an example of an editable gridview containing different ASP.NET controls. When user wants to edit values in gridview, she/he can use these controls to edit existing values in Gridview Edit Mode.

Using the Code

watermark textbox using Ajax control

This is pretty simple compared to jquery. Since we need refer a dll only. we dont want any script for this. we just include that reference into our website.

jquery autocomplete multiple values


i got some samples and i did autocomplete using jquery , its working well for single input values

but i need to pass multiples values after one by one in the textbox. Is it possible to pass multiple

values in the textbox for autocomplete in jquery in asp.net?


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

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