Free Support Forum - aspose.com

Getting parameters in JavaScript

Hi,

how do I get the number of columns and number of rows of the current worksheet in JavaScript?

Thanks!

Rudolf Gütlich

Hi,

Thanks for considering Aspose.

Well, if you want to get the maximum row / column index in a sheet on the client side (JavaScript), you may define some attributes on the server side and fill them with the related data, get these attributes on the client side (JavaScript).

E.g.,

On the server side in the .aspx page, you may add a few lines in Page_Load event handler:

private void Page_Load(object sender, System.EventArgs e)

{

if (!IsPostBack)

{

.................

GridWeb1.Attributes["actsheet"] = GridWeb1.WebWorksheets.ActiveSheet.Name;

GridWeb1.Attributes["maxrow"] = GridWeb1.WebWorksheets[0].Cells.MaxRow.ToString() ;

GridWeb1.Attributes["maxcol"] = GridWeb1.WebWorksheets[0].Cells.MaxColumn.ToString() ;

}

}

On the client side (JavaScript) in the .html source, you may add:

.

.

.

.

Specify the client fucntion:


.
.

Thank you.