We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

TextBox with Multi Column Autocomplete

Dear Sir :

Good day, today, I'm try to bind DataTable to AutoComplete 
This table have 3 column.
From my code :

Dim cpAutoComplete as new Syncfusion.Windows.Forms.Tools.AutoComplete
cpAutoComplete.DataSource = dtTable ' DataTable with 3 columns
cpAutoComplete,RefreshColumns()
cpAutoComplete,Item(0).Visable = false ' Hidden primary key
cpAutoComplete,Item(1).ColumnHeaderText= "Code"
cpAutoComplete,Item(2).ColumnHeaderText= "Name"

Therefore have a textboxext name TxtName autocomplete link to above object

My question is , how to display the text of column 3 in textboxext  textbox  (i.e. "Name" column), when user match or select item from popup autocomplete list

Thanks

Michael





3 Replies

SK Senthil Kumaran Rajan Syncfusion Team August 5, 2015 07:15 AM UTC

Hi Michael,

Thank you for using Syncfusion products.

In AutoComplete, this reported requirement can be achieved by using its property named MatchingColumn. Please make use of the below code snippet.

MatchingColumn:

This property will define Column that will be used by the AutoComplete control to perform matching with the current content (at runtime) of the target control.

Code Snippet[C#]:

//To display the Fourth column in TextBoxtExt

this.autoComplete1.Columns[3].MatchingColumn = true;


We have also prepared the sample for your reference and it can be downloaded from the below location.

Sample Location : http://www.syncfusion.com/downloads/support/forum/119820/ze/AutoCompleteTextBoxExt-319099742

Please let us know if you need further assistance.

Regards,
Senthil


MK Michael K August 5, 2015 10:02 AM UTC

Hi Senthil:

Thanks for your help, base on you provide sample, I  try to add the below code, it will not work.
 
            this.autoComplete1.RefreshColumns();
            //To display the Fourth column in TextBoxtExt
            // modify
            this.autoComplete1.Columns[0].ColumnHeaderText = "test0";
           this.autoComplete1.Columns[1].ColumnHeaderText = "test1";
            this.autoComplete1.Columns[2].ColumnHeaderText = "test2";
            this.autoComplete1.Columns[3].ColumnHeaderText = "test3";
That's mean if I assign columnheadertext, it will only return the first column value in textBoxExt1
Is this a problem ?

Thanks
Michael



SK Senthil Kumaran Rajan Syncfusion Team August 6, 2015 04:42 AM UTC

Hi Michael,

We considered this behavior with AutoComplete as bug and a support incident has been created under your account, to track the status of this requirement. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

Regards,
Senthil

Loader.
Live Chat Icon For mobile
Up arrow icon