I have a DataGrid which holds a number of objects. Within that DataGrid, I have a RowDetailsTemplate to house all of the hierarchical data. I want to be able to select the object from within that DataGrid, but so far haven't had any luck with the following code

<DataGrid x:Name="leagueList" Grid.Row="1" ItemsSource="{Binding Leagues}" SelectedItem="{Binding SelectedLeague}" Margin="0,0,5,0" ColumnWidth="1*" CanUserAddRows="False" AutoGenerateColumns="False" IsReadOnly="True" CanUserReorderColumns="False" CanUserSortColumns="False"> <DataGrid.Resources> <utility:SubtractValueConverter x:Key="SubtractValueConverter"/> </DataGrid.Resources> <DataGrid.RowHeaderTemplate> <DataTemplate> <Expander Expanded="Expander_Expanded" Collapsed="Expander_Collapsed"/> </DataTemplate> </DataGrid.RowHeaderTemplate> <DataGrid.Columns> <DataGridTextColumn Header="League" Binding="{Binding Name}"/> <DataGridTextColumn Header="Initials" Binding="{Binding Initials}"/> </DataGrid.Columns> <DataGrid.RowDetailsTemplate> <DataTemplate DataType="{x:Type models:Team}"> <DataGrid ItemsSource="{Binding Teams}" SelectedItem="{Binding Path=SelectedTeam, UpdateSourceTrigger=PropertyChanged}" CanUserAddRows="False" AutoGenerateColumns="False" IsReadOnly="True" GridLinesVisibility="All" Width="{Binding ActualWidth,ElementName=leagueList, Converter={StaticResource SubtractValueConverter}, ConverterParameter=50}" HorizontalAlignment="Stretch" ColumnWidth="*" Margin="1,1,1,1" BorderThickness="2"> <DataGrid.Columns> <DataGridTextColumn Header="Nickname" Binding="{Binding Nickname}"/> </DataGrid.Columns> </DataGrid> </DataTemplate> </DataGrid.RowDetailsTemplate> </DataGrid>

The SelectedTeam Property is what I want to be called when a Team is selected, but it doesn't appear to be bound to that property, even though I'm specifying it as such.

public Team SelectedTeam { get => _SelectedTeam; set { _SelectedTeam = value; System.Windows.MessageBox.Show("Selected Team is: " + _SelectedTeam.Nickname); RaisePropertyChangedEvent("SelectedTeam"); } }

When I run my app, I don't even get the MessageBox popup when I select a Team, but I should.

The entire grid populates properly, I just can't get the SelectedItem from the inner DataGrid.