Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

hi

i have a combobox with below code:

CBCustomer.DataSource = DS.DSFactor.Customer

CBCustomer.DisplayMember = "Custom_Name"

CBCustomer.ValueMember = "id"

 

but when i use

TextBox5.Text = CBCustomer.SelectedValue.ToString()

the value is not equl by the id field in my table

what should i do?

 

:confused:

 

thanks

Posted

hi

for example i have below records

 

id custom_name

------ -------------------

1 one

2 two

3 three

 

and my selectedtem is "one" but the selectedvalue=3

and if for example my selecteditem=two then selectedvalue=1

and so on

i can not access to my id from the combobox.selectedvalue

Posted

hi

ds is instance of Component Class

dsfactor is instance of dataset

and customer is my table in dataset

and custom_name and id are fields of customer table.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...