Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/06/15 13:26:30 (9 years ago)
Author:
mkommend
Message:

#2352: Reverse merged r12137 and implemented a format pattern for the EnhancedStringConvertibleMatrixView.

Location:
trunk/sources/HeuristicLab.Data.Views/3.3
Files:
2 edited

Legend:

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

    r12012 r12151  
    4545    public double Minimum { get; set; }
    4646
     47    public string FormatPattern { get; set; }
     48
    4749    public new DoubleMatrix Content {
    4850      get { return (DoubleMatrix)base.Content; }
     
    5254    public EnhancedStringConvertibleMatrixView() {
    5355      InitializeComponent();
     56      FormatPattern = string.Empty;
    5457    }
    5558
     
    5760      columnVisibility = null;
    5861      rowVisibility = null;
     62    }
     63
     64    protected override void dataGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e) {
     65      if (Content != null && e.RowIndex < Content.Rows && e.ColumnIndex < Content.Columns) {
     66        int rowIndex = virtualRowIndices[e.RowIndex];
     67        e.Value = Content[rowIndex, e.ColumnIndex].ToString(FormatPattern);
     68      }
    5969    }
    6070
  • trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs

    r12077 r12151  
    281281      dataGridView.Rows[e.RowIndex].ErrorText = string.Empty;
    282282    }
    283     private void dataGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e) {
     283    protected virtual void dataGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e) {
    284284      if (Content != null && e.RowIndex < Content.Rows && e.ColumnIndex < Content.Columns) {
    285285        int rowIndex = virtualRowIndices[e.RowIndex];
Note: See TracChangeset for help on using the changeset viewer.