Ottieni la convalida della cella nei file ODS
Contents
[
Hide
]
Ottieni la Convalida Cellulare nei File ODS
Con Aspose.Cells, è possibile ottenere la convalida applicata a una cella nei file ODS. A questo scopo, l’API fornisce il metodo GetValidation della classe Cell.
Il seguente esempio di codice dimostra l’uso del metodo GetValidation caricando il file ODS di origine e leggendo la convalida della cella A9.
Codice di Esempio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
//Source directory | |
string sourceDir = RunExamples.Get_SourceDirectory(); | |
//Load source Excel file | |
Workbook workbook = new Workbook(sourceDir + "SampleBook1.ods"); | |
//Access first worksheet | |
Worksheet worksheet = workbook.Worksheets[0]; | |
Cell cell = worksheet.Cells["A9"]; | |
if (cell.GetValidation() != null) | |
{ | |
Console.WriteLine(cell.GetValidation().Type); | |
} |