Combobox, DataSource and SelectedItem issue

  • Thread starter Daniel Bello Urizarri
  • Start date
D

Daniel Bello Urizarri

Hello:

I have a Combobox with a DataTable as DataSource, using one of the
DataColumns as the DisplayMembers. Everything works fine.
When the user selects an item, the SelectedItem property returns a
DataRowView with the selected row.

My problem is that I can no initialize the combobox to a selected value.
How can it be done?
 
G

Guest

Hi

You should also bind the valuemember of the combobox to the relevant field
in your dataset. Once done you can set the SelectedValue property of the
combobox to make it select the required value

Hope that helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top