Introduction
In this topic, we will discuss about the most basic thing and that is about accessing worksheets of Aspose.Grid.Web control. We can also call these worksheets as Web Worksheets because of the fact that they belong to Aspose.Grid.Web and are used in web applications.
Accessing a Worksheet
All worksheets contained in Aspose.Grid.Web, are stored in a WebWorksheets collection of GridWeb control. There are two ways to access a particular worksheet, one by its Sheet Index and other by its Sheet Name.
Using Sheet Index
Developers can access a specific worksheet by specifying its Sheet Index in the WebWorksheets collection of GridWeb control as demonstrated below in the example code snippet.
Example:
[C#]
//Accessing a worksheet using its index
WebWorksheet sheet = GridWeb1.WebWorksheets[0];
[VB.NET]
'Accessing a worksheet using its index
Dim sheet As WebWorksheet = GridWeb1.WebWorksheets(0)
Using Sheet Name
Developers can also access a specific worksheet by specifying its Sheet Name in the WebWorksheets collection of GridWeb control as demonstrated below in the example code snippet.
Example:
[C#]
//Accessing a worksheet using its name
WebWorksheet sheet = GridWeb1.WebWorksheets["sheet1"];
[VB.NET]
'Accessing a worksheet using its name
Dim sheet As WebWorksheet = GridWeb1.WebWorksheets("sheet1")