I am a beginner in .net. This could be a silly question. I want to disable ctrl + c and ctrl + v keyboard shortcuts.
Before asking here I tried these codes link1 and link2 (not working)
private void dgvMain_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
this.dgvMain.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
}
private void dgvMain_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
{
this.dgvMain.ClipboardCopyMode = DataGridViewClipboardCopyMode.Disable;
}
and also
this.dgvMain.ClipboardCopyMode = DataGridViewClipboardCopyMode.Disable;
dgvMain
is datagridview
I maybe missing something here.
EDIT:
The properties for my datagridview which I have altered are:
AllowUserToResizeColumns -- False
AllowUserToResizeRows -- False
ClipboardCopyMode -- disable
ColumnsHeadersHeightSizeMode -- AutoSize
Dock -- Fill
ReadOnly -- True
TabStop -- False
Please help
Thanks in Advance.