I have a datagrid which is bound to a collection on my ViewModel. When the window loads the datagrid is populated and the SelectedItem is set. (I know this because I have a detail view bound to the selected item.) The row however is not highlighted. If I click on the row then it will be highlighted and works normally.
How do I make the selected row appear highlighted when its the default selection?
<DataGrid IsSynchronizedWithCurrentItem="True" SelectionUnit="FullRow" RowHeaderWidth="0" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible" IsReadOnly="True" ItemsSource="{Binding Items}" SelectedItem="{Binding Path=SelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" AutoGenerateColumns="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Run Date" Binding="{Binding Path=RunDate, StringFormat={}{0:MM-dd-yy HH:mm:ss} }" />
<DataGridTextColumn Header="Description" Binding="{Binding Description}" />
<DataGridTextColumn Header="Duration" Binding="{Binding Duration}" />
<DataGridTextColumn Header="Deviation" Binding="{Binding Deviation}" />
</DataGrid.Columns>
</DataGrid>