JavaScript UI Libraries & Blazor Components Suite – Smart UI Forums Data Grid Make grid readonly, allow selection and copy.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #103570
    cwardell
    Participant

    Is there a way to make SMART.Grid truly readonly, yet allow selection and copying from it?

    I have editing.enabled = false, which seems to prevent editing, but the delete key and ctrl-X still cut content.

    If I set clipboard.enabled = false, ctrl-X no longer cuts, but I also cannot copy with ctrl-C.

    Thanks,

    Chris Wardell

     

     

     

    • This topic was modified 2 years, 2 months ago by cwardell.
    #103643

    Hi,

    You can leave the clipboard enabled and add a callback for the onKey event.
    In the callback, you will prevent the default behaviour if the ctrlKey is pressed and the keycode is KeyX.

    onKey: (e) => {
    if(e.ctrlKey && e.code === “KeyX”) {
    e.preventDefault();
    }
    }

    Have a look at this demo: https://codepen.io/svetoslavb04/pen/gOzORrG

    If you have any additional questions, do not hesitate to ask!

    Best Regards,
    Svetoslav Borislavov

    Smart UI Team
    https://www.htmlelements.com/

    #103644
    cwardell
    Participant

    Thanks, Svetoslav!  That works perfectly.  I really appreciate the help.

    Chris Wardell

     

    #103646

    Hi,

    Thank you for the update! I am so happy to hear that. If you need any help, let us know!

    Best Regards,
    Svetoslav Borislavov

    Smart UI Team
    https://www.htmlelements.com/

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.