I’m using enableBlockSelection. I want to set value directly to make a selection zone.
I have seen the following API, but I don’t know how to set instance or value to grid._selectionArea.
grid._selectionArea
grid._selectionArea.LeftTopRow
grid._selectionArea.LeftTopCol
grid._selectionArea.RightBottomRow
grid._selectionArea.RightBottomCol
You may try to use the following API:
topr=mygrid.getSelectedBlock().LeftTopRow
botr=mygrid.getSelectedBlock().RightBottomRow
lcol=mygrid.getSelectedBlock().LeftTopCol
rcol=mygrid.getSelectedBlock().RightBottomCol
function onKeyPressed(code,ctrl,shift){
if(code==67&&ctrl){
if (!mygrid._selectionArea) return alert("You need to select a block area in grid first");
mygrid.setCSVDelimiter("\t")
mygrid.copyBlockToClipboard()
mygrid.clearSelection()
}
if(code==86&&ctrl){
mygrid.setCSVDelimiter("\t")
mygrid.pasteBlockFromClipboard()
}
if(code==88&&ctrl){
if (!mygrid._selectionArea) return alert("You need to select a block area in grid first");
mygrid.setCSVDelimiter("\t")
mygrid.copyBlockToClipboard()
topr=mygrid.getSelectedBlock().LeftTopRow
botr=mygrid.getSelectedBlock().RightBottomRow
lcol=mygrid.getSelectedBlock().LeftTopCol
rcol=mygrid.getSelectedBlock().RightBottomCol
var i,j
for (i=topr;i<=botr;i++){
for (j=lcol;j<=rcol;j++){
mygrid.cells2(i,j).setValue("")
}
}
}
return true;
}
What I want to do is “set the values” instead of getting the values of selection zone.
I have tried something like this to make 3 cells (column 9 of row 0 and 2) to be selected, but not working…