We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Client Side Script

Is there any client side script that retunrs with row and column was selected. I saw that there is getActiveColumn() , and getActiveRow(). But I didn´t see "getActiveColumnRow()"

Thank you

Hi,

The two functions just return the column number and the row number of the active cell. And use the getSelectedCells function to get the array of the selected cells.

Hi,

Well there is no "getActiveColumnRow()" client side javascript method. Alternatively we have getActiveCell() method which can retrieve the column no and row number for the cell which is active or selected. And you may also use getActiveColumn(), getActiveRow() functions for your need which returns active column and row number.

Thank you.

Hi,

Well, I need that my client click on a cell, I get the row and column number using JavaScript or without postback. How do I do it?

Thank you!

Hi,

Thanks for considering Aspose.

Well, you may do it using onCellSelected client-side javascript event.

First use OnCellSelectedClientFunction attribute to set it to event handler i.e., and write your javascript function as event handler for the event. e.g.,


.
.
.


Thank you.

Hi,

Well, I do it, but when I load my webpage and select a cell, apears a javascript error: GridWeb1 is not defined!

Thank you

Hi,

Well, the error shows that your gridweb control has different name instead of GridWeb1. Please update the following line to change your correct GridWeb control's name:

e.g.,

var cell = GridWeb1.getActiveCell();

Thank you.

I´m sure that the name is the same! Take a look...

<agw:GridWeb ID="GridWeb1" runat="server"

function onCellSelected(cell)

{

var cell = GridWeb1.getActiveCell();

if (cell != null)

{

window.alert("Cell row:" + GridWeb1.getCellRow(cell) + " Cell column: " + GridWeb1.getCellColumn(cell));

}

}

Hi,

Well, it looks so strange to me. Could you give us some details: OS, .Net Framework, Browser type, IIS etc. And are you using Microsoft AJAX extention for .Net 2.0 i.e. GridWeb control with the AJAX extention web control "UpdatePanel" etc.?

Thank you.

So, I´m using Ajax Extention for .Net2.0, btu my gridwed isn´t in UpdatePanel.

Windows Xp Sp2.
IE 7.0
IIS Default of Windows XP

Thank you

Hi,

Well, To implement the GridWeb control on AJAX, you should have a licensed version of the control.

You will have to add a few lines in Web.config file also(These settings will work for Asp.net AJAX. The grid conflicts with some ajax framework. You may try to add a config setting to the web.config: Be sure that the client files(images, scripts) are correctlly installed at the URL path "/agw_client/". This config prevent the control from using embeded client resource(images, scripts, etc.). And this config will only take effect with LICENSED controls):

appSettings>

Thank you.

Hi,

When you add the grid to a container, the client side id of the grid may not be the same as its server ID. The client side id which can be used in a javascript function could be "Container_GridWeb1". So please check the client side source to ensure you are using the correct client side id.

And at server side, you may get the correct client side id with GridWeb.ClientID property.

Thank you.

Hi, it works fine !

Hi, is there how get the hyperlink´s value in javascript (client side).

Thank you!!

Hi,

Well, you can access Hyperlink object's properties, kindly consult the following:

.
.
For example in the page_load event handler, you may define attributes to store hyperlink's data.

GridWeb1.Attributes["hurl"] = hyperlink1.Url;
GridWeb1.Attributes["htext"] = hyperlink1.Text;
.
.
.
And in the html mode javascript code you may access them.
.

.
var url = GridWeb1.hurl;
var text = GridWeb1.htext;
.

.



Thank you.

Hi,

To get a hyperlink's value is the same with to get a common cell's value.

var row = 1;

var column = 2;

var cell = GridWeb1.getCell(row, column);

alert(GridWeb1.getCellValueByCell(cell);