Hi,
I am building a WebGrid where a user will select a cell which will correlate to a "width x height" dimension. The columns of the WebGrid represent Width and the Rows represent height. My first column holds the height values. I do not want the user to be able to select the cells in the first column. Is there anyway to disable cell or column selection/activation?
Thanks
Brent
Hi Brent,
You can handle the WebGrid's BeforeCellChangeHandler on the client side and identify the column the cell belongs to and cancel the action if the column should not allow the change to take place, similar to the following:
function UltraWebGrid1_BeforeCellChangeHandler(gridName, cellId){
var cell = igtbl_getCellById(cellId);
if (cell.Column.Key == "Col0"){
return true;
}
Matthew,
I have been trying to duplicate this functionality and cannot. Here's my code
function UltraWebGrid1_BeforeCellChangeHandler(gridName, cellId){ var cell = igtbl_getCellById(cellId); switch (cell.Column.Key) { case "MoveRow": case "RowOrder": case "Name": case "Department": case "Position": case "TotalHours": cell.setSelected = false; return true; break; default: break; }}
The cell remains selected and subsequent calls to UltraWebGrid1.DisplayLayout.SelectedCells have the cell in the SelectedCellsCollection.
Any ideas?
Meh, I've been looking at this for too long today and missing the obvious.
Should be cell.setSelected(false); and it works fine.
One other question. I have SelectTypeCellDefault set to Extended. When I drag select across these "non selectable" all but the last cell become selected. Any way you know of to stop this?