I am binding a data table to combobox like as i show in code below .
objComboBox.ItemsSource = objDataTableNew.DefaultView;
objComboBox.DisplayMemberPath = objDataTableNew.Columns[0].ToString();
objComboBox.SelectedValuePath = objDataTableNew.Columns[1].ToString();
objComboBox.SelectedIndex = 0;
Now i want to add combo box item with display text as “select” and value as “-1” to the top of the list .
Directly i cant add since itemsource is bound with data table.
I tried inserting a row to objDataTableNew at index zero . but i am having a prob . 0th column of datatable obtained from DB is a integer column. So i cant insert a string value “select” to that column .
How do i achieve this ?
1 Answer