0

I have this code in my program:

dataGridTextColumn2.Binding = new Binding(
   (comboBox1.SelectedValue as ComboBoxItem).Content.ToString());

I want to convert this code to XAML like this:

<DataGridTextColumn Header="Header" 
    Binding="{Binding ElementName=comboBox1, Path=SelectedValue.Content, Mode=OneWay}"
    x:Name="dataGridTextColumn2" />

But this XAML code is doesn't work. Could you tell me where I am wrong?

4

0 回答 0