1

I have grid in a WPF window and a DataGrid control inside:

<DataGrid x:Name="gridDataContent"
          AutoGenerateColumns="False"
          Background="White"
          BorderBrush="#FFE6E6E6"
          CanUserAddRows="False"
          CanUserDeleteRows="False"
          ItemsSource="{Binding ProductCollection}"
          SelectedItem="{Binding SelectedProduct}"
          SelectionUnit="FullRow">
    <DataGrid.Resources>
        <Style TargetType="DataGridRow">
            <Style.Resources>
                <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}"
                                 Opacity="0.5"
                                 Color="DodgerBlue" />
                <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrush}" Color="DodgerBlue" />
            </Style.Resources>
        </Style>
    </DataGrid.Resources>
    <DataGrid.Columns>
        <DataGridTextColumn Width="350"
                            Binding="{Binding FullName}"
                            Header="Name"
                            IsReadOnly="True" />
        <DataGridTextColumn Binding="{Binding ProductSale.Barcode}"
                            Header="Barcode"
                            IsReadOnly="True" />
        <DataGridTextColumn Binding="{Binding Quantity}"
                            Header="Quantity"
                            IsReadOnly="True" />
        <DataGridTextColumn Binding="{Binding WriteOffQuantity}"
                            Header="Writeoff quantity"
                            IsReadOnly="False" />
    </DataGrid.Columns>
</DataGrid>

when you click the writeoff 2 times, the devenv.exe process takes a lot of memory and continuously growing, then Visual Studio 2015 closed crash exception there OutOfMemoryException. ProductCollection is of type ObservableCollection < ProductModel >, the number of records is not more than 1000. In what may be a problem? P.S. Sorry for my bad english

0 Answers0