FlexGrid for WPF | ComponentOne
C1.WPF.FlexGrid.4.6.2 Assembly / C1.WPF.FlexGrid Namespace / CellRange Structure / Cells Property
Example

In This Topic
    Cells Property (CellRange)
    In This Topic
    Gets an System.Collections.IEnumerable that can be used to iterate over the cells in this CellRange.
    Syntax
    'Declaration
     
    Public ReadOnly Property Cells As IEnumerable(Of CellRange)
    public IEnumerable<CellRange> Cells {get;}
    Example
    The code below shows how you can use the Cells property to add all integer values in a given cell range.
    var total = 0;
    foreach (var cell in rng.Cells)
    {
      var value = grid[cell.Row, cell.Column];
      if (value is int)
      {
        total += (int)value;
      }
    }
    See Also