Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- XAML:
- <Window x:Class="TestListBinding.MainWindow"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:local="clr-namespace:TestListBinding"
- mc:Ignorable="d"
- Title="MainWindow" Height="350" Width="525">
- <Grid>
- <DataGrid HorizontalAlignment="Left" Height="239" Margin="42,32,0,0" VerticalAlignment="Top" Width="435"
- ItemsSource="{Binding Projects, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
- SelectedItem="{Binding SelectedProject}"
- IsReadOnly="False"
- AlternatingRowBackground="LightBlue" AutoGenerateColumns="False">
- <DataGrid.Columns>
- <DataGridTextColumn Header="Project Title" Binding="{Binding ProjectTitle,UpdateSourceTrigger=PropertyChanged}"/>
- <DataGridTextColumn Header="Project Details" Binding="{Binding ProjectDetails,UpdateSourceTrigger=PropertyChanged}"/>
- </DataGrid.Columns>
- </DataGrid>
- </Grid>
- </Window>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement