ExcelTable.GetCell C# (CSharp) Méthode

GetCell() public méthode

public GetCell ( int row, int column ) : ExcelTableCell,
row int
column int
Résultat ExcelTableCell,
    public ExcelTableCell GetCell(int row, int column)
    {
        if (cells.ContainsKey(row))
        {
            if (cells[row].ContainsKey(column))
            {
                return cells[row][column];
            }
        }
        return null;
    }

Usage Example

        public void ExcelCellExtractionTest()
        {
            var document = ExcelDocumentFactory.CreateFromTemplate(File.ReadAllBytes(GetFilePath("template.xlsx")), logger);
            var table    = new ExcelTable(document.GetWorksheet(0));

            var cell = table.GetCell(new CellPosition("B9"));

            cell.Should().NotBeNull();
            cell.StringValue.Should().Be("Template:RootTemplate:B10:D11");

            cell = table.GetCell(new CellPosition("ABCD4234"));
            cell.Should().BeNull();
        }
All Usage Examples Of ExcelTable::GetCell