Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Display selecteditem from a comboxbox on Datagrid

$
0
0
   

I have a `combobox` and a `datagrid` in my application. The datagrid has its itemsSource from its collectionViewSource resource key(using Entity Framework) and there are three `ComboBoxItem`'s inside 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.

XAML for ComboBox

<ComboBox SelectedItem="{Binding DetailsViewSource.Type}" 
     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>

XAML for Datagrid       

<DataGrid AutoGenerateColumns="False" 
       Foreground="DarkBlue" EnableRowVirtualization="True" Height="auto"
       HorizontalAlignment="Left" ItemsSource="{Binding}" Name="dataGrid1">








Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>