أضف Cell عمليات التحقق من صحة البيانات

إنشاء التحقق من صحة البيانات في GridCell من GridWeb

يقوم نموذج التعليمات البرمجية التالي بإنشاء ملفتأكيد صحة البيانات في الخلية B3. إذا أدخلت أي قيمة ليست بين 20 و 40 ، فستظهر الخلية B3خطئ في التحقق في شكلأحمر XXXX كما هو موضح في لقطة الشاشة هذه.

ما يجب القيام به: image_بديل_نص

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Access first worksheet
GridWorksheet sheet = GridWeb1.WorkSheets[0];
// Access cell B3
GridCell cell = sheet.Cells["B3"];
// Add validation inside the gridcell
// Any value which is not between 20 and 40 will cause error in a gridcell
GridValidation val = cell.CreateValidation(GridValidationType.WholeNumber, true);
val.Formula1 = "=20";
val.Formula2 = "=40";
val.Operator = GridOperatorType.Between;
val.ShowError = true;
val.ShowInput = true;