Changeset 11037


Ignore:
Timestamp:
06/25/14 10:26:12 (5 years ago)
Author:
pfleck
Message:

Fixed possible NullReferenceException in DataGridView.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.cs

    r11002 r11037  
    140140    protected override void dataGridView_SelectionChanged(object sender, EventArgs e) {
    141141      base.dataGridView_SelectionChanged(sender, e);
    142       Content.Selection = GetSelectedCells();
     142      if (Content != null)
     143        Content.Selection = GetSelectedCells();
    143144    }
    144145
     
    567568
    568569      foreach (var selectedCell in dataGridView.SelectedCells) {
    569         var cell = (DataGridViewCell) selectedCell;
    570         if (!selectedCells.ContainsKey(cell.ColumnIndex)) 
     570        var cell = (DataGridViewCell)selectedCell;
     571        if (!selectedCells.ContainsKey(cell.ColumnIndex))
    571572          selectedCells.Add(cell.ColumnIndex, new List<int>(1024));
    572573        selectedCells[cell.ColumnIndex].Add(cell.RowIndex);
Note: See TracChangeset for help on using the changeset viewer.