<DataGrid DockPanel.Dock="Top" ItemsSource="{Binding Path=Routes, Mode=TwoWay}" AutoGenerateColumns="False" CanUserDeleteRows="True" CanUserAddRows="True" IsSynchronizedWithCurrentItem="True" GridLinesVisibility="All" > <DataGrid.Resources> <ObjectDataProvider x:Key="Modules" ObjectType="{x:Type serv:PortPinDataService}" MethodName="GetModules"/> </DataGrid.Resources> <DataGrid.Columns> <DataGridTemplateColumn Header="Module" Width="*"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <ComboBox ItemsSource="{Binding Source={StaticResource Modules}}" DisplayMemberPath="Name" SelectedItem="{Binding Path=CurrentModule, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"> </ComboBox> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> <DataGridComboBoxColumn Header="Module" ItemsSource="{Binding Source={StaticResource Modules}}" SelectedItemBinding="{Binding Path=CurrentModule, UpdateSourceTrigger=PropertyChanged}" Width="80" DisplayMemberPath="Name" > <DataGridComboBoxColumn.ElementStyle> <Style TargetType="ComboBox"> <Setter Property="Width" Value="80"/> </Style> </DataGridComboBoxColumn.ElementStyle> </DataGridComboBoxColumn> <DataGridTemplateColumn Header="Signal" Width="*"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <ComboBox ItemsSource="{Binding Path=SignalsByModule}" DisplayMemberPath="SignalName" SelectedItem="{Binding Path=CurrentSignalRegister, UpdateSourceTrigger=PropertyChanged}"></ComboBox> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> <DataGridTemplateColumn Header="Route to" Width="*"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <ComboBox ItemsSource="{Binding Path=Registers}" DisplayMemberPath="RegRouteInfo"></ComboBox> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> </DataGrid.Columns> </DataGrid>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)