Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a file .txt :
N1 abc
N2 dfg
N3 kjh
N4 2sa
N5 8ds
.....
How can i load {N1,N2........}to combobox?
and when i search a code : N1
textbox will show : N1 abc
Posted

I'd say the only way would be to parse your txt file and store the parsed data into a class, or a KeyValuePair List or what's better in your situation and then just iterate thru your items.

You also can create your class to store the Key / Value info, and then override the ToString function so you can display the data as you desire.

Hope it helps.
 
Share this answer
 
v3
Comments
Simon_Whale 27-Jul-11 4:40am    
Good answer. +5
Split the text on the space delimiiter for every row in the file.
Then add the first item in the returned array into the dropdown.
 
Share this answer
 

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