Click here to Skip to main content
16,005,149 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
iam working on windows application form
i fill textbox inside dtatagrid with autocompletet list from the code down

C#
public void AutoComplete()
{
    AutoCompleteStringCollection AutoItem = new AutoCompleteStringCollection();
    foreach (DataRow rw in Dt.rows)
    {
    AutoItem.Add(Rw["columnname"].ToString());
    }
    texbox.AutoCompleteMode = AutoCompleteMode.Suggest;
    texbox.AutoCompleteSource = AutoCompleteSource.CustomSource;
    texbox.AutoCompleteCustomSource = AutoItem;
}


it's working good but my problem when i use one item i need to get the id for that items
to be more clear i dir items for sql db so i dir itemname & when i choose item i need to get the selected itemid
like how we do with ajax autocomplete extnder in asp.net
Posted
Updated 25-Jan-14 21:30pm
v2
Comments
Karthik_Mahalingam 26-Jan-14 2:38am    
what issue you are facing?
not clear
[no name] 26-Jan-14 2:51am    
my issue is when i select item name form autcomplete list in textbox i want to get the id for that item
Karthik_Mahalingam 26-Jan-14 3:02am    
post your full code

1 solution

Did you try to look at
AutoItem.IndexOf(textbox.Text) ?
 
Share this answer
 
Comments
Rahul VB 26-Jan-14 12:56pm    
this could help

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900