إضافة Cell الحماية في ورقة العمل
Contents
[
Hide
]
يسمح لك Aspose.Cells لـ GridDesktop بحماية الخلايا في ورقة العمل. تحتاج أولاً إلى حماية ورقة العمل الخاصة بك ، ثم يمكنك حماية الخلايا التي تريدها في ورقة العمل. من أجل حماية ورقة العمل ، يرجى ضبطورقة العمل الخاصية إلى صحيح ، ثم استخدمورقة العمل. SetProtected () طريقة لحماية نطاق الخلايا.
قم بحماية Cell باستخدام Aspose.Cells.GridDesktop
يحمي نموذج التعليمات البرمجية التالي كافة الخلايا الموجودة في النطاقA1: B1 من ورقة العمل النشطة لـ GridDesktop. عندما تنقر نقرًا مزدوجًا فوق أي خلية في هذا النطاق ، فلن تتمكن من التحرير. سيجعل هذه الخلايا للقراءة فقط.
This file contains hidden or 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 | |
// Accessing the worksheet of the Grid that is currently active | |
Worksheet sheet = gridDesktop1.GetActiveWorksheet(); | |
// Make sure sheet has been protected | |
sheet.Protected = true; | |
// Choose a cell range | |
CellRange range = sheet.CreateRange("A1", "B1"); | |
// Set protected range area on Worksheet | |
sheet.SetProtected(range, true); |