DataGridComboBoxColumn SelectedItemBinding

Jan 26, 2009 at 10:29 AM


I have a problem of setting the selected value in DataGridComboBoxColumn.

<dg:DataGridComboBoxColumn  x:Name ="joinComboBox"                                      
                   SelectedItemBinding="{Binding Join}"
                     Width=" 120">

I have set the DataGridComboBoxColumn  ItemsSource as below

Microsoft.Windows.Controls.DataGridComboBoxColumn combo = (Microsoft.Windows.Controls.DataGridComboBoxColumn)dualInputJoinerDataGrid.FindName("joinComboBox");
                combo.ItemsSource = matchFields;

matchFields is an arrayList
Join is a property of string type and I need the value of the Join property to be as the selected value in the DataGridComboBoxColumn

I have read gone through
and bind the SelectedItemBinding as in the above code but it does not work.

How can I solve this issue?

Thanks in advance.

Jan 26, 2009 at 12:30 PM
Is matchFields an arralist of strings?  If not, you should try to use SelectedValue and SelectedValuePath.
Jan 27, 2009 at 2:45 AM
Yes matchFields is an array of strings.
Jan 27, 2009 at 10:06 AM
I tried with SelectedValue and SelectedValuePath as well nothing is working
Jan 28, 2009 at 12:02 PM
Does something like this work,