We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Read-Only / ctrl+C ctrl+V

Hi, I set gridcontrol.colStyles(colIndex).readOnly=true. But users can paste values from clipboard and they are accepted. How can I avoid this ? Thanks Louis

2 Replies

AD Administrator Syncfusion Team January 22, 2005 07:02 PM UTC

If you are pasting data ffrom outside teh grid, say excel, then the readonly cell should stop the paste. But if you copying and pasting data from a GridControl, then the default behavior is to copy and paste style information (as opposed to just pasting text from outside the gid). In this case, the readonly setting does not stop the paste. One simple thing you can do is to turn off the default support for copying styles. this.gridControl1.CutPaste.ClipboardFlags &= ~GridDragDropFlags.Styles; If you need teh style copying, but want to not paste over the readonly cells, then you would have to handle the ClipboardPaste event, get the GridData object directly from the Clipboard and set the values into the grid yourself, checking the existing style.ReadOnly for each cell before setting the value.


LL Louis Lebrun January 22, 2005 08:19 PM UTC

Tnank''s very much for your help. Louis

Loader.
Up arrow icon