How to bind a Combo Box to DataSet in code behind, without using XAML at all:
I tried the following, but all my combobox items are “System.Data.DataRowView” instead of the actual value. What is wrong?
string str = @"SELECT * FROM FooTable";
da.SelectCommand = new SqlCeCommand(str, connection);
da.Fill(devDs, "FooTable");
dt = ds.Tables["FooTable"];
comboBox1.ItemsSource = devDt.DefaultView;
You will have to set
DisplayMemberPathproperty