Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
137
Row Selection using CellClickAction.Edit
posted

I need to allow row selection in my grid while using the CellClickAction.Edit default action.  This is an editable grid and we wish to have a cell selector visible on the screen allowing the user to arrow or tab around the grid.  I have javascript code that will select the row whenever the cell is changed by using the CellChangeHandler.  However, I am unable to select multiple rows if the user holds down shift or control for example.  I would also like to be able to click and drag down the grid to select rows like in the CellClickAction.RowSelect functionality.  Is this possible to do?

Here is my Row Selection code as a reference:

function setSelectedGridRow(astrActiveCell){
var objSelectedRow;
var objCell = igtbl_getCellById(astrActiveCell);
var objRow = objCell.getRow();

if (objRow.getSelected())
{}
else{
objRow.setSelected(
true);
}
}

Thanks,
KyleL

Parents
  • 45049
    posted

    WebGrid already has a "row selector", which sounds like it will achieve the results you want, including allowing multiple selection (assuming you've enabled multiple row selection).  To display the row selectors for all bands in your grid, set the DisplayLayout.RowSelectorsDefault property to RowSelectors.Yes - or you can set this for a particular band by setting its RowSelectors property.

Reply Children