Få tillgång till arbetsblad
Contents
[
Hide
]
Det här ämnet diskuterar åtkomst till kalkylblad i Aspose.Cells.GridWeb-kontrollen. Vi kommer att kalla dem “webbkalkylblad” eftersom de tillhör Aspose.Cells.GridWeb och används i webbapplikationer.
Få åtkomst till ett arbetsblad
Alla kalkylblad som finns i Aspose.Cells.GridWeb, lagras i GridWeb-kontrollens GridWorksheetCollection. Det finns två sätt att komma åt ett kalkylblad: genom dess arkindex eller genom dess arknamn.
Använder Sheet Index
Kodavsnittet nedan visar hur du kommer åt ett specifikt webbkalkylblad från GridWeb-kontrollens GridWorksheetCollection med hjälp av arkindexet.
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 a worksheet using its index | |
GridWorksheet sheet = GridWeb1.WorkSheets[0]; | |
Label1.Text = "Sheet at index 0 is : " + sheet.Name + "<br/>"; |
Använder arknamn
Kodavsnittet nedan visar hur man kommer åt ett webbkalkylblad från GridWeb-kontrollens GridWorksheetCollection-samling med hjälp av arknamnet.
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 a worksheet using its name | |
GridWorksheet sheet1 = GridWeb1.WorkSheets["Catalog"]; | |
Label1.Text += "Index of sheet Catalog is : " + sheet1.Index + "<br/>"; |