getActiveRow() and Firefox

C#, Asp.net 2.0, Visual Studio 2005.

Tested on IE7 versus Firefox 3.0.13

Hopfully this is a quick and easy one.

I'm trying to capture the row and column of the active cell when the user clicks via Javascript. (See attached files). Because I've got a 3rd party tab control inside of a Master page, I'm grabbing the control Client ID name at run time. For demonstration purposes I'm doing something like this in Javascript on the cell's click event:

var eX = 0;

var eY = 0;

function ExcelSelectCell(cell)

{

alert('cell selected');

// <%= grdExcel.ClientID %>.updateData();

// <%= grdExcel.ClientID %>.validateAll();

var cell = <%= grdExcel.ClientID %>.getActiveCell();

alert('cell2');

//CommentHere

alert('Row:' + <%= grdExcel.ClientID %>.getActiveRow() + ' Column:' + <%= grdExcel.ClientID %>.getActiveColumn());

if (cell != null){

window.alert('Cell row:' + <%= grdExcel.ClientID %>.getCellRow(cell) + ' Cell column: ' + <%= grdExcel.ClientID %>.getCellColumn(cell));

eX = <%= grdExcel.ClientID %>.getCellRow(cell);

eY = <%= grdExcel.ClientID %>.getCellColumn(cell);

}

}

This works just fine in Internet Explorer. For whatever reason it is not working in Firefox. Suggestions?

Hi,

Thanks for providing us the project template files.

I have tested and found the issue in the Firefox after an initial test as your code works fine in IE browser. We have logged your issue into our internal issue tracking system with an issue id: CELLSNET-11795. We will look into your issue and let you know if there is any update for it. Just for your information, not all the GridWeb’s features are available on non-IE browsers like Firefox. The GridWeb control provides full features and works fine in IE browser. So, there might be restriction of handling client side event(s) in Firefox browser. Anyways, we will check it and update you soon.

Thank you.


Hi,

Please change your code a bit (as mentioned below):


function ExcelSelectCell(cell)

{

var grid = document.getElementById('<%= grdExcel.ClientID %>');

var cell = grid.getActiveCell();

alert(cell);

//CommentHere

alert('Row:' + grid.getActiveRow() + ' Column:' + grid.getActiveColumn());

if (cell != null){

window.alert('Cell row:' + grid.getCellRow(cell) + ' Cell column: ' + grid.getCellColumn(cell));

eX = grid.getCellRow(cell);

eY = grid.getCellColumn(cell);

}

}

This supports both IE and FireFox.

Thank you.

Thank you. That worked perfectly!