Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Combobox initially loads with the id not the name
 

Combobox initially loads with the id not the name

Hi there,

I have dragged over my a details view of a table i have in a dataset. This table has some foreign keys to in the column of country it might have the value of countryId = 1 which would mean that in the country table the record 1 is USA.
So I make those fields comboboxes and wire them up so that it displays the country name but saves the country id into the table.
My problem is that initially when the form loads it doesn't show the country name but instead shows the countryid. However if i expand my combobox it will display a list of country names?

If anyone can help I'd appreciate it. Thanks
mongoose_za  Wednesday, July 29, 2009 1:41 PM
Do you have the DataPropertyName set for the column?
www.insteptech.com ; msmvps.com/blogs/deborahk
We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
DeborahK  Thursday, August 13, 2009 11:48 PM
You probably should postthe appropriate snippetsof your code, so that we can see what you're missing.
~~Bonnie Berent [C# MVP]
BonnieB  Sunday, August 16, 2009 2:20 PM

You can use google to search for other answers

Custom Search

More Threads

• Refresh DataGrid bound to relation
• Problem binding a ListBox to a DataSet
• Scrolling 2 DataGridViews Simultaneously.
• Load DataGridView with only a subset of records
• To increase datagrid ComboBox Drop Down Length
• Copy a row from one Datagrid to another Datagrid
• Datagrid Header as Combo box
• BindingSource and ComboBox and not selecting anything
• error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
• date sometimes not saving