الحصول على التحقق من الخلية في ملفات ODS
Contents
[
Hide
]
الحصول على التحقق من الخلية في ملفات ODS
مع Aspose.Cells، يمكنك الحصول على التحقق المطبق على خلية في ملفات ODS. لهذا الغرض، يوفر واجهة برمجة التطبيقات الوسيلة GetValidation للفئة Cell.
توضح العينة البرمجية التالية استخدام الأسلوب GetValidation من خلال تحميل ملف ODS المصدر وقراءة التحقق من صحة الخلية A9.
الكود المثالي
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); | |
} |