Hot fix 1.9.0.1- supports setting ActiveCell for the grid at server-side

files:

aspose.grid.web.dll, copy this file to your app bin folder

commonbehav.htc,commonbehav.js, copy these two files to the /agw_client/

Hi, I am using aspose grid 1.8, I want to know if I need to install aspose grid 1.9 before doing that. I want to know what is the code to set the Active Cell (this.GridWeb1.???????).

Thx in advanced.

In the latest version, you can use GridWeb.ActiveCell property to set it.

It worked, now I can set the ActiveCell, but when I tryied to get the ActiveCell at server side, after clicking at some cell, using the "GridWeb.ActiveCell property", the application threw a "NullReferenceExcepcion". Plz help me.

Hi,

We will figure out and get back to you soon.

Thank you.

Ok I will be waiting. Thx in advanced

Hi,

How do you call GridWeb.ActiveCell property to get the active cell?

Following is my code and it works fine to get the active cell when I double-click on any cell in the sheet:

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

{

GridWeb1.EnableDoubleClickEvent = true;

}

private void GridWeb1_CellDoubleClick(object sender, Aspose.Grid.Web.CellEventArgs e)

{

Response.Write( GridWeb1.ActiveCell.Name);

GridWeb1.WebWorksheets[0].Cells["A1"].PutValue(GridWeb1.ActiveCell.Row.ToString());

}

Thank you.

It works fine for the "GridWeb1_CellDoubleClick" event but if you use a "Button1_Click" event instead, it doesn't work and throw the NullReferenceException.

What I need is that after clicking (only once) in any cell, getting the value of the row or column from this ActiveCell inside a Button_Click event like that:

protected void Button1_Click(object sender, EventArgs e)

{

int a = GridWeb1.ActiveCell.Row;

}

Hi,

Well you may try to use some Session level variable(s) and store the value(s) of the active cell in it/them when you double click on the cell. And in the button_Click event handler, you may get the Session level variable's value in which you have stored the cell info.

Thank you.

Good advice, I used a Session variable and it worked really fine, Thank you so much.

Hi,

The ActiveCell property will be null object when no cell is selected. So you should check the property and be sure it isn't null before you use it.