I have a datagrid source attribute of ObservableCollection, when I change something from the collection, the collection changes but the view does not show until I click on the line. What is the problem?

<DataGrid CanUserResizeRows="True" RowHeight="32" SelectionUnit="FullRow" SelectionMode="Extended" Grid.Row="2" Background="White" ItemsSource="{Binding Configs, UpdateSourceTrigger=PropertyChanged}" AutoGenerateColumns="False" ColumnHeaderStyle="{DynamicResource DataGridColumnHeaderStyle}"> <DataGridTextColumn Header="Description" Binding="{Binding Path=Description, UpdateSourceTrigger=PropertyChanged}" Width="*"/> 

MVVM

 private ObservableCollection<Config> _configs = new ObservableCollection<Config>(); public ObservableCollection<Config> Configs { get { return _configs; } set { _configs = value; OnPropertyChanged("Configs"); } } 
  • I did not find a better duplicate (I am sure that there is), but still, here is the answer . - EvgeniyZ
  • @EvgeniyZ does not work) tried already) - Mike Waters
  • And write about it? Write about your solutions? In WPF, there are a couple of types of data updates, it’s standardly like “if the focus is lost”, because this is how much less work goes. The answer above tells how to deliver when the value changes. If this does not work for you, then the data is somehow not correctly bind and updated, or something else interferes. Without a code and without data, we are not your assistants .. - EvgeniyZ
  • @EvgeniyZ added the code - Mike Waters
  • one
    Follow the two rules. 1. In no case should you know about the View from the code, that is, you should not call textBox1.Text = "111"; or something like that, the maximum is a DataContext, then work with data, collections and other things is simple, we don’t touch View !. Well, make sure that each VM / M is responsible only for its one thing. Let's say the bus, people on the bus. Here is a bus - a separate object that contains other objects (motor, wheels, people, etc.). People are another object, with their objects and functions. But with such a distinction you have nothing special to break. - EvgeniyZ

0