public XlsxWriter AddDataValidation(XlsxDataValidation dataValidation) { return(AddDataValidation(CurrentRowNumber, CurrentColumnNumber, 1, 1, dataValidation)); }
public XlsxWriter AddDataValidation(int fromRow, int fromColumn, int rowCount, int columnCount, XlsxDataValidation dataValidation) { return(DoOnWorksheet(() => _currentWorksheet.AddDataValidation(fromRow, fromColumn, rowCount, columnCount, dataValidation))); }
public XlsxWriter AddDataValidation(int rowCount, int columnCount, XlsxDataValidation dataValidation) { return(AddDataValidation(CurrentRowNumber, CurrentColumnNumber, rowCount, columnCount, dataValidation)); }
public void AddDataValidation(int fromRow, int fromColumn, int rowCount, int columnCount, XlsxDataValidation dataValidation) { if (rowCount < 1 || columnCount < 1) { throw new ArgumentOutOfRangeException(); } var cellRef = rowCount > 1 || columnCount > 1 ? $"{Util.GetColumnName(fromColumn)}{fromRow}:{Util.GetColumnName(fromColumn + columnCount - 1)}{fromRow + rowCount - 1}" : $"{Util.GetColumnName(fromColumn)}{fromRow}"; if (!_cellRefsByDataValidation.TryGetValue(dataValidation, out var cellRefs)) { cellRefs = new List <string>(); _cellRefsByDataValidation.Add(dataValidation, cellRefs); } cellRefs.Add(cellRef); }