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

Read-Only / ctrl+C ctrl+V

Thread ID:





23892 Jan 22,2005 06:39 PM UTC Jan 22,2005 08:19 PM UTC WinForms 2
Tags: GridControl
Louis Lebrun
Asked On January 22, 2005 06:39 PM UTC

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 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.

Louis Lebrun
Replied On January 22, 2005 08:19 PM UTC

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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon