Getting column header name in javascript

Hi ,

I can get column number using GridWeb1.getActiveColumn() using

onCellSelected client side function

but i want corresponding column name for the active column or cell how to get that in javascript function?




I think you may use your own code to get the Column names based on the column indexes


function onCellSelected(cell)


var col = this.getActiveColumn();

names = new Array("A","B","C","D","E","F","G","H","I","J","K","L","M");

window.alert("Column Name: " + names[col]);


Alternatively, you may use GridWeb.ActiveCell.Name attribute to get the Cell name of the active cell in the grid.

Thank you.

Hi there

I have tried GridWeb.ActiveCell.Name but it gives me error

i am using visual studio 2003 and aspose version 2.0

my columns are dynamic so can't use first option




Where did you put GridWeb.ActiveCell.Name in the code, I tried it on server side using the the latest version, it works fine. And what is the error, could you give us complete error description/text.

Could you try the latest version of the GridWeb v2.0.1: Please let us know if you still find the issue.

Thank you.

i have seen the link u gave but i want column name in javascript ....

how to get that column name in javascript .I am using aspose 2.0

with visual studio 2003




Well, you should use GridWeb.ActiveCell.Name attribute to get the Cell name of the active cell in the grid on the server side or use your own javascript code (onCellSelected event) as described in my previous post. If you are setting some custom column headers, you may use the following code on server side to get the custom column headers:

WebWorksheet worksheet = GridWeb1.WebWorksheets[0];

string colcaption = GridWeb1.WebWorksheets[0].Cells.GetColumnCaption(GridWeb1.ActiveCell.Column);