Prevent RowChecker 'Check All' from modifying disabled checker cell

1 reply. Last post: June 7, 2010 2:32 AM by Yudi
Tags :
  • New Discussion
  • New Question
  • New Product Feedback

Hi,

I'm disabling some checker cells in the InitializeRow event, but these are somehow still editable through the 'Check All' checkbox that's avaible on the header of the checker column.

I'm disabling the cells in the initializeRow with a snippet like this:

if (e.Row.Type == RowType.Record)
            {
                //Get the checker cell
                WebGridCellCollection cells = e.Row.Cells;
                var checkerCell = cells[0];
                //Randomize
                bool disabled = cells[2].Text.Length % 2 ==0;
                checkerCell.ForceNoEdit = disabled;
            }

 

But when I click the 'Check All' checkbox they end up checked/unchecked anyways.

Is there a way to prevent this? I was think of reversing the value on the OnCheckBoxClick clientside event, but the issue persists. I was using something like this:

function DoNotCheckDisabled(gridId, tblName, colName, checkboxValue, originalCheckboxvalue) {
        var grid = ISGetObject(gridId);
        var row = grid.Tables[tblName].ToRowObject(grid.CheckedRowContext);
        if (checkerCell = row.GetCell('Checker').ForceNoEdit == true) {
            row.GetCell('Checker').SetValue(false, true);             
        }        
    }

 

Any ideas would be appreciated.

Thanks

All times are GMT -5. The time now is 1:31 PM.
Previous Next