Koruyun Cells
Contents
[
Hide
]
Bu konuda, hücreleri korumaya yönelik birkaç teknik açıklanmaktadır. Bu tekniklerin kullanılması, geliştiricilerin, kullanıcıların bir çalışma sayfasındaki tüm veya seçili hücre aralığını düzenlemesini kısıtlamasına olanak tanır.
Koruma Cells
Aspose.Cells.GridWeb, kontrol devredeyken hücrelerdeki koruma seviyesini kontrol etmek için birkaç farklı teknik sunar.Düzenleme modu (varsayılan mod). Bu, hücreleri son kullanıcılar tarafından değiştirilmekten korur.
Tümünü Yapma Cells Salt Okunur
Çalışma sayfasındaki tüm hücreleri salt okunur olarak ayarlamak için çalışma sayfasının SetAllCellsReadonly yöntemini çağırın.
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 | |
// Accessing the reference of the worksheet that is currently active | |
GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex]; | |
// Setting all cells of the worksheet to Readonly | |
sheet.SetAllCellsReadonly(); |
Cells’in Tümünü Düzenlenebilir Hale Getirmek
Tüm hücrelerden korumayı kaldırmak için çalışma sayfasının SetAllCellsEditable yöntemini çağırın. Bu yöntem, SetAllCellsReadonly yönteminin tersi etkiye sahiptir.
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 | |
// Accessing the reference of the worksheet that is currently active | |
GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex]; | |
// Setting all cells of the worksheet to Editable | |
sheet.SetAllCellsEditable(); |
Seçileni Yapma Cells Salt Okunur
Yalnızca bir hücre aralığını korumak için:
- Önce SetAllCellsEditable yöntemini çağırarak tüm hücreleri düzenlenebilir yapın.
- Çalışma sayfasının SetReadonlyRange yöntemini çağırarak korunacak hücre aralığını belirtin. Bu yöntem, hücre aralığını belirtmek için satır ve sütun sayısını alır.
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 | |
// Accessing the reference of the worksheet that is currently active | |
GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex]; | |
// Setting all cells of the worksheet to Editable first | |
sheet.SetAllCellsEditable(); | |
// Finally, Setting selected cells of the worksheet to Readonly | |
sheet.SetReadonlyRange(3, 2, 4, 1); |
Seçilen Cells Düzenlenebilir Hale Getiriliyor
Bir hücre aralığının korumasını kaldırmak için:
- SetAllCellsReadonly yöntemini çağırarak tüm hücreleri salt okunur yapın.
- Çalışma sayfasının SetEditableRange yöntemini çağırarak düzenlenebilir olacak hücre aralığını belirtin. Bu yöntem, hücre aralığını belirtmek için satır ve sütun sayısını alır.
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 | |
// Accessing the reference of the worksheet that is currently active | |
GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex]; | |
// Setting all cells of the worksheet to Readonly first | |
sheet.SetAllCellsReadonly(); | |
// Finally, Setting selected cells of the worksheet to Editable | |
sheet.SetEditableRange(3, 2, 4, 1); |