I have a combobox
and a datagrid
in my application. The datagrid has its itemsSource from its collectionViewSource and there are three ComboBoxItem
's in the combobox as warning/error/exception as shown in the image below.
How to display the selecteditem row details on the datagrid when the respective ComboxBoxitem
is selected.
this what I have tried. Combobox - XAML
<ComboBox
SelectedValuePath="{Binding ElementName=dataGrid1,Path=SelectedItem.Type,Mode=OneWay}"
Grid.Column="1" Height="32" HorizontalAlignment="Left" Name="comboBox1" >
<ComboBoxItem Content="Warning"/>
<ComboBoxItem Content="Error"/>
<ComboBoxItem Content="Exception"/>
</ComboBox>
datagrid's XAML
<DataGrid AutoGenerateColumns="False"
IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding}" Name="dataGrid1">
is it possible to achieve this via XAML skipping code behind ? if not other suggestions are also most welcome.
CDATA
but i doesn't know how to use this and i would recommend to use normal code like Raul Otaño does it in his example – WiiMaxx