Free cookie consent management tool by TermsFeed Policy Generator

Changeset 10626


Ignore:
Timestamp:
03/19/14 14:23:30 (11 years ago)
Author:
rstoll
Message:

interpolation was enabled when no string columns was selected even when user was in the first row - fixed

File:
1 edited

Legend:

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

    r10623 r10626  
    6767    }
    6868
    69     void dataGridView_KeyUp(object sender, KeyEventArgs e) {
    70       var selectedRows = dataGridView.SelectedRows;
    71       if (e.KeyCode == Keys.Delete && selectedRows.Count > 0) {
    72         List<int> rows = new List<int>();
    73         for (int i = 0; i < selectedRows.Count; ++i) {
    74           rows.Add(selectedRows[i].Index);
    75         }
    76         triggersOwnEvent(() => {
    77           Content.DataGridLogic.DeleteRow(rows);
    78           OnContentChanged();
    79         });
    80       }
    81     }
    82 
    8369    protected override void OnContentChanged() {
    8470      base.OnContentChanged();
    8571    }
    86 
    8772
    8873    protected override void RegisterContentEvents() {
     
    152137    }
    153138
     139    private void dataGridView_KeyUp(object sender, KeyEventArgs e) {
     140      var selectedRows = dataGridView.SelectedRows;
     141      if (e.KeyCode == Keys.Delete && selectedRows.Count > 0) {
     142        List<int> rows = new List<int>();
     143        for (int i = 0; i < selectedRows.Count; ++i) {
     144          rows.Add(selectedRows[i].Index);
     145        }
     146        triggersOwnEvent(() => {
     147          Content.DataGridLogic.DeleteRow(rows);
     148          OnContentChanged();
     149        });
     150      }
     151    }
    154152
    155153    private void dataGridView_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) {
     
    168166            columnIndices.Add(dataGridView.SelectedCells[i].ColumnIndex);
    169167          }
    170           averageToolStripMenuItem.Enabled = medianToolStripMenuItem.Enabled = randomToolStripMenuItem.Enabled = interpolationToolStripMenuItem.Enabled = !Content.DataGridLogic.AreAllStringColumns(columnIndices);
     168          averageToolStripMenuItem.Enabled = medianToolStripMenuItem.Enabled = randomToolStripMenuItem.Enabled = !Content.DataGridLogic.AreAllStringColumns(columnIndices);
     169          interpolationToolStripMenuItem.Enabled = interpolationToolStripMenuItem.Enabled && !Content.DataGridLogic.AreAllStringColumns(columnIndices);
    171170          contextMenuCell.Show(MousePosition);
    172171        }
Note: See TracChangeset for help on using the changeset viewer.