Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3324 for trunk


Ignore:
Timestamp:
04/13/10 11:12:49 (15 years ago)
Author:
mkommend
Message:

fixed small bug in StringConvertibleMatrixView (ticket #968)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs

    r3320 r3324  
    8080      base.OnContentChanged();
    8181      sortedColumnIndizes.Clear();
    82       virtualRowIndizes = new int[0];
    8382      if (Content == null) {
    8483        Caption = "StringConvertibleMatrix View";
     
    9089        dataGridView.Columns.Clear();
    9190        dataGridView.Enabled = false;
     91        virtualRowIndizes = new int[0];
    9292      } else {
    9393        Caption = "StringConvertibleMatrix (" + Content.GetType().Name + ")";
     
    101101      columnsTextBox.Text = Content.Columns.ToString();
    102102      columnsTextBox.Enabled = true;
     103      virtualRowIndizes = Enumerable.Range(0, Content.Rows).ToArray();
     104      dataGridView.EndEdit();
    103105      dataGridView.RowCount = 0;
    104106      dataGridView.ColumnCount = 0;
    105107      if ((Content.Rows > 0) && (Content.Columns > 0)) {
    106         virtualRowIndizes = Enumerable.Range(0, Content.Rows - 1).ToArray();
    107108        dataGridView.RowCount = Content.Rows;
    108109        dataGridView.ColumnCount = Content.Columns;
     
    217218    }
    218219    private void dataGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e) {
    219       if (e.RowIndex < virtualRowIndizes.Length) {
    220         int rowIndex = virtualRowIndizes[e.RowIndex];
    221         e.Value = Content.GetValue(rowIndex, e.ColumnIndex);
    222       }
     220      int rowIndex = virtualRowIndizes[e.RowIndex];
     221      e.Value = Content.GetValue(rowIndex, e.ColumnIndex);
    223222    }
    224223
Note: See TracChangeset for help on using the changeset viewer.