DataGridComboBoxColumn SelectedItemBinding

Jan 26, 2009 at 11:29 AM

Hi,

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

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

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
http://blogs.msdn.com/vinsibal/archive/2008/10/31/wpf-datagrid-datagridcomboboxcolumn-v1-intro.aspx
and bind the SelectedItemBinding as in the above code but it does not work.

How can I solve this issue?

Thanks in advance.
Kanchana








Coordinator
Jan 26, 2009 at 1:30 PM
Is matchFields an arralist of strings?  If not, you should try to use SelectedValue and SelectedValuePath.
Jan 27, 2009 at 3:45 AM
Yes matchFields is an array of strings.
Jan 27, 2009 at 11:06 AM
I tried with SelectedValue and SelectedValuePath as well nothing is working
Coordinator
Jan 28, 2009 at 1:02 PM
Does something like this work, http://www.codeplex.com/wpf/Thread/View.aspx?ThreadId=45372?