Changeset 3337


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

fixed bug in StringConvertibleMatrixView (ticket #968)

File:
1 edited

Legend:

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

    r3335 r3337  
    105105      virtualRowIndizes = Enumerable.Range(0, Content.Rows).ToArray();
    106106      //DataGridViews with Rows but no columns are not allowed !
    107       if (Content.Rows == 0 && dataGridView.RowCount != Content.Rows)
     107      if (Content.Rows == 0 && dataGridView.RowCount != Content.Rows && !Content.ReadOnlyView)
    108108        Content.Rows = dataGridView.RowCount;
    109109      else
    110110        dataGridView.RowCount = Content.Rows;
    111       if (Content.Columns == 0 && dataGridView.ColumnCount != Content.Columns)
     111      if (Content.Columns == 0 && dataGridView.ColumnCount != Content.Columns && !Content.ReadOnlyView)
    112112        Content.Columns = dataGridView.ColumnCount;
    113113      else
     
    245245    }
    246246    private void dataGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e) {
    247       int rowIndex = virtualRowIndizes[e.RowIndex];
    248       if (e.RowIndex < Content.Rows && e.ColumnIndex < Content.Columns)
     247      if (e.RowIndex < Content.Rows && e.ColumnIndex < Content.Columns) {
     248        int rowIndex = virtualRowIndizes[e.RowIndex];
    249249        e.Value = Content.GetValue(rowIndex, e.ColumnIndex);
     250      }
    250251    }
    251252    private void dataGridView_Scroll(object sender, ScrollEventArgs e) {
Note: See TracChangeset for help on using the changeset viewer.