I have a datagrid contains sensitive data, which is, only allows user to read, nothing more (no modifying, no copying,…). How can I archive that? Datagrid has Readonly property, but I think it does not prevent user from copying data.
EDIT: I don’t need to prevent user completely from copying data, just not allow them to copy easily mass data.
You COULD try to disable the copy functions. Perhaps you could take over Ctrl-C in a desktop application, and even Print-Screen – they could be ‘disabled’ for a desktop app. That doesn’t ensure that the user doesn’t have another software process to take their place.
There’s really a lot of effort you could go to, but there are other ‘copying’ procedures that you wouldn’t be able to stop:
Are you using a DataGridView in WinForms? It sounds like you were looking for something on the grid to detect + prevent copying. You could try the
Enabledproperty, set tofalse. That would at least disallow the mass selection by use of the top left button.