DHTMLX Docs & Samples Explorer

Index
dhtmlxgrid
API Methods

### selectCell(r, cInd, fl, preserve, edit, show)

Required library edition:
Required library file: dhtmlxgrid.js

set selection to specified row-cell

- r - row object or row index
- cInd - cell index
- [fl] - true if to call onRowSelect function (optional, false by default)
- preserve - preserve previously selected rows true/false (optional, false by default). Multi select mode should be enabled.
- edit - switch selected cell to edit mode (optional, false by default)
- show - true/false - scroll row to view (optional, true by default)

       //select second cell from the first row.
       mygrid.selectCell(0,1);
       //select second cell from the first row, call "onRowSelect" event, preserve previously selected rows
       mygrid.selectCell(0,1,true,true);
       //select second cell from the 11th row, switch cell to the edit mode
       <button onclick="(arguments[0]||window.event).cancelBubble=true;mygrid.selectCell(10,1,false,false,true)">select cell</button>

Please make sure that necesary cell is loaded before calling this method

See also: selectRow, showRow