This is a migrated thread and some comments may be shown as answers.

RadGrid ContextMenu Column Index Changes on Hide

1 Answer 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Santosh
Top achievements
Rank 1
Santosh asked on 20 Oct 2008, 03:55 PM
Hi,

While checking the RadGrid Context menu, i have a scenario wherein

i show different context menu, based on the click in a cell. based on its content.

So if is a Address which is in Address column, i give a link to Google maps and so on.

The problem is i allow to hide columns. When a column is hidden, the column number i get is as per what is displayed, rather than the virtual column number(which would factor in the hidden columns).

How can i get around this.

function

 

RowContextMenu(sender, eventArgs)

 

{

 

var cellIndex = eventArgs.get_domEvent().target.cellIndex;

 

 

var colName = eventArgs.get_tableView().get_columns()[cellIndex].get_uniqueName();

 

So in the above i get the physical cell index rather than the one which factors that there are hidden columns before that. Is there anyway around this.

Regards,
Santosh

1 Answer, 1 is accepted

Sort by
0
Santosh
Top achievements
Rank 1
answered on 21 Oct 2008, 08:29 AM
Got this resolved on the RadGrid:

var cellIndex = eventArgs.get_domEvent().target.cellIndex;

 

 

var kk = 0;

 

 

for(var i = 0; i < sender.get_masterTableView().get_columns().length; i++){

 

 

if(sender.get_masterTableView().get_columns()[i].get_element().cellIndex == cellIndex)

 

{

kk = i;

}

}

 

cellIndex = kk;



Tags
Grid
Asked by
Santosh
Top achievements
Rank 1
Answers by
Santosh
Top achievements
Rank 1
Share this question
or