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.
Unfortunately, activation email could not send to your email. Please try again.

Read-Only / ctrl+C ctrl+V

Thread ID:





23892 Jan 22,2005 01:39 PM Jan 22,2005 03:19 PM Windows Forms 2
Tags: GridControl
Louis Lebrun
Asked On January 22, 2005 01:39 PM

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

Administrator [Syncfusion]
Replied On January 22, 2005 02:02 PM

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.

Louis Lebrun
Replied On January 22, 2005 03:19 PM

Tnank''s very much for your help. Louis


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.