I would like to have in the client function handling the OnCellSelectedClientFunction event, a way to convert the array returned by the getSelectedCells as a list of cell coordenades.
The code would somthing like:
function onCellSelected(cell) { var cls=this.getSelectedCells(); var values; if (cls==null) values=this.getActiveColumn()+';'+this.getActiveRow(); else { var i; for(i in cls) { values=values+i.getCellColumn()+';'+i.getCellRow()+'|'; } }
SetObjectValueById("lblSelection",values) }
But, it should work!!!! And my code doesn't. Can you please help?
Currently you can't get the selected range in the cellselected event. You may get the selected range in a button click event. We will fix this issue soon.
Well, you can't use onCellSelected event for getting the selected range of cells. Actually this event is fired when the first cell in the cells range is selected.
Probably you can tell me if there is another way to do what I want.
I need to do some operatation with the selected cells after the user click some button (outside the grid command). Now, when the user does the click, the page will reload (due to the postback) and I lose the selection range. I would need to store that information, so I can performe my operation with the cells.
You can get the selected range at server side and process them. Just use GridWeb.SelectedCells property to get the collection of the selected cells. Each item of this collection is an ArrayList which contains cells in one selected row.
If you are using a button outside of the grid, you should add some client side code to let the button update the grid's postback data when it is clicked.