TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Dharshini
NA
24
24.9k
Binding DataGrid Details to Selected Item in a combobox
Mar 15 2013 7:39 AM
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-
http://tempuri.org/tempuri.html
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">
Kindly help. Thanks
Reply
Answers (
0
)
Master form in wpf
refresh datagrid items without losing selected row - XAML