JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Data Grid › Make grid readonly, allow selection and copy. › Reply To: Make grid readonly, allow selection and copy.
September 2, 2022 at 1:01 pm
#103643
svetoslav_borislavov
Participant
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/