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
45
Prevent Paste operation (ctrl+V) for a column...
posted

I have a webgrid with serveral columns.  I've built a context menu to do copy and paste within the grid, but I want to prevent the user from using ctrl+V to paste into one of the columns.  Is this possible?

Parents
No Data
Reply
  • 14049
    Offline posted
    Assuming you're using the grid's built-in pasting functionality you can
    handle the BeforeClipboardOperation client side event and check if the
    active cell belongs to the column where pasting is not allowed the
    simply return true from the event handler.

    function grdStatus_BeforeClipboardOperation(gridName, operationType,
    options){
    //Add code to handle your event here.
    var grid = igtbl_getGridById(gridName);
    if(operationType!=grid.eClipboardOperation.Paste)
    return;
    var activeCell = grid.getActiveCell();
    if (activeCell && activeCell.Column.Key == "NoPastingColumn")
    return true;
    }
Children
No Data