Çalışma Sayfalarını Kaldırma
Contents
[
Hide
]
Bu konu, Aspose.Cells.GridWeb API’sını kullanarak Microsoft Excel dosyalarından çalışma sayfalarını nasıl kaldıracağınız hakkında bilgi sağlar. Bir çalışma sayfasını, sayfa dizinini veya adını belirterek kaldırmak mümkündür.
Bir Çalışma Sayfasını Kaldırmak
Sayfa Dizinini Kullanarak Kullanma
Aşağıdaki kod, GridWorksheetCollection’ın RemoveAt metodunda sayfa indeksini belirterek bir çalışma sayfasının nasıl kaldırılacağını gösterir.
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 | |
if (GridWeb1.WorkSheets.Count > 2) | |
{ | |
// Removing a worksheet using its index | |
GridWeb1.WorkSheets.RemoveAt(1); | |
} |
Sayfa Adını Kullanma
Aşağıdaki kod, GridWorksheetCollection’ın RemoveAt metodunda sayfa adını belirterek bir çalışma sayfasının nasıl kaldırılacağını gösterir.
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 | |
// Removing a worksheet using its name | |
if (GridWeb1.WorkSheets["Teachers"] != null) | |
{ | |
GridWeb1.WorkSheets.RemoveAt("Teachers"); | |
} |
Ayrıca, bir çalışma sayfasını referans veya örneğini kullanarak kaldırmak da mümkündür. Bunun için GridWorksheetCollection’ın Remove metodunu kullanın. Bu yaklaşım genellikle kullanılır.