Click here to Skip to main content
14,422,648 members
Rate this:
Please Sign up or sign in to vote.
See more:
I bind textbox with autocomplte feature and its working fine to me.
But I want to save id not the text.
For example :
Id : 1
Value : Nilesh

In textbox autocomplete I am showing 'Nilesh' as value which is correct but in db I want to save id '1'.

Can you tell me how I can do this?

What I have tried:

i tried lots of way to do but nothing help to me.
No way to get id of selected text.
Posted
Updated 1-Dec-19 6:20am
Rate this:
Please Sign up or sign in to vote.

Solution 1

Maybe you can do it with a ComboBox, see CodeProject article: Auto Complete ComboBox[^]
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

create object on client side to store id and name.. bind that classitme with your combobox and set Displayname as name.
when you select the item you get the instance of that class where you can access the all properties.
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100