احصل على Cell التحقق من صحة ODS في ملفات

احصل على Cell التحقق من صحة ODS في ملفات

باستخدام Aspose.Cells ، يمكنك الحصول على التحقق المطبق على خلية في ملف ODS. لهذا ، يوفر API امتدادGetValidation طريقةCell صف دراسي.

يوضح نموذج التعليمات البرمجية التالي استخدامGetValidation طريقة عن طريق تحميلالمصدر ODS ملف وقراءة التحقق من صحة الخلية A9.

عينة من الرموز

// 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);
}