I have a combobox that I would like to fill with the column names of my dataset. I tried three different methods and none worked correctly. The first method I tried to bind the combobox and the program would not compile due to an error on making the window. The second method fills my combo box with seemingly random numbers in place of the column name strings. The third method was sort of a last ditch attempt and it didn't fill anything. I'm sure all the methods are simple errors and I would prefer to have the first method of databinding fixed cause it allows a little more flexibility.
Binding drop_down = new Binding();
drop_down.Source = sim1.Tables.Columns.ColumnName;
//drop_down.Path = new PropertyPath("
int i = 0;
foreach (DataColumn column in myDataSet.Tables["data"].Columns)
string colname = column.ColumnName.ToString();
i = ++i;
cmbXAxis.DataContext = myDataSet.Tables["data"].Columns;
cmbXAxis.DisplayMemberPath = myDataSet.Tables["data"].Columns.ToString();
cmbXAxis.SelectedValuePath = myDataSet.Tables["data"].Columns["Count"].ToString();