title: SetSelectedRange Spread.NET javascript issue
body: <p>I'm trying to add functionality to Spread.NET control where it will permit a hold shift-click to select a range of cells in ASP.
  I'm creating the event onActiveCellChanged to call the selectRange function on execution</p>
  
  <pre><code>   var shiftPressed = false;
     var newSelect = true;
  
     window.pageLoad = function init() {
         var ss = document.getElementById('&lt;%=FpSpread1.ClientID %&gt;');
  
         if (ss.addEventListener != null) {
             ss.addEventListener("ActiveCellChanged", selectRange(), false);
         } else if (ss.attachEvent != null) {
             ss.attachEvent("ActiveCellChanged", selectRange());
         }
         else {
             FpSpread1.onActiveCellChanged = selectRange;
         }
     }
  </code></pre>
  
  <p>Here is the selectRange function.</p>
  
  <pre><code>        function selectRange() {
              var ss = document.getElementById('&lt;%=FpSpread1.ClientID %&gt;');
              var swap;
  
              if (shiftPressed == true) {
                  var initRow = document.getElementById('RowCoord').value;
                  var initCol = document.getElementById('ColCoord').value;
                  var SecRow = getRow();
                  var SecCol = getCol();
                  newSelect = false;
  
                  var rCount = Math.abs(SecRow - initRow) + 1;
                  var cCount = Math.abs(SecCol - initCol) + 1;
  
                  if (initRow &gt; SecRow)
                      initRow = SecRow;
  
                  if (initCol &gt; SecCol)
                      initCol = SecCol;
  
                  //alert(initRow + ' ' + initCol);
                  alert(initRow + ' ' + initCol + ' ' + rCount + ' ' + cCount);
                  ss.SetSelectedRange(initRow, initCol, rCount, cCount);
  
              }
              else {
                  document.getElementById('RowCoord').value = 0;
                  document.getElementById('ColCoord').value = 0;
                  newSelect = true;
              }
          }
  </code></pre>
  
  <p>And this is how I'm determining whether shift is being held.</p>
  
  <pre><code>        function aKeyDown(event) {
  
              if (event.keyCode == 16) {
  
                  shiftPressed = true;
                  var col = getCol();
                  var row = getRow();
  
                  if (newSelect) {
                      document.getElementById('RowCoord').value = row;
                      document.getElementById('ColCoord').value = col;
                  }
              }
          }
  
          function aKeyUp(event) {
  
              if (event.keyCode == 16) {
                  shiftPressed = false;
              }
          }
  
          function getRow() {
              var ss = document.getElementById('&lt;%=FpSpread1.ClientID %&gt;');
              ret = ss.ActiveRow;
  
              if (ret == undefined)
                  ret = ss.GetActiveRow;
  
              return ret;
          }
  
          function getCol() {
              var ss = document.getElementById('&lt;%=FpSpread1.ClientID %&gt;');
              ret = ss.ActiveCol;
  
              if (ret == undefined)
                  ret = ss.GetActiveCol;
  
              return ret;
          }   
  </code></pre>
  
  <p>The <code>SetSelectedRange</code> in the select range function will work if my initial cell is a,1.  However, if it's any other cell, it'll select the entire row and column.</p>
  
  <p>Here is my <code>&lt;div&gt;</code> tag:</p>
  
  <pre><code>&lt;FarPoint:FpSpread onkeydown="aKeyDown(event)" onkeyup="aKeyUp(event)" ID="FpSpread1"...
  </code></pre>
  
  <p>In image 1, My initial cell was (a,3) and I held shift and clicked on (b,4)</p>
  
  <p>In image 2, it works. As long as I start at cell (a,1)</p>
  
  <p><img src="https://i.stack.imgur.com/4qsK4.jpg" alt="Image 1">
  <img src="https://i.stack.imgur.com/t11ie.jpg" alt="Image 2"></p>