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

Cut operation

Thread ID:





22468 Dec 14,2004 08:47 AM UTC Dec 16,2004 08:24 AM UTC WinForms 7
Tags: GridControl
Administrator [Syncfusion]
Asked On December 14, 2004 08:47 AM UTC

For one of the columns i have set Enabled property = false and readonly property = true. But one i perform a cut operation on the row the contents of this column also gets cut which is exactly i don''t want. I could not figure out why. Can you please help?

Administrator [Syncfusion]
Replied On December 14, 2004 09:05 AM UTC

What version are you using? Using, and setting these properties, I am unable to cut this cell. this.gridControl1[2,4].Text = "1"; this.gridControl1[2,4].Enabled = false; this.gridControl1[2,4].ReadOnly = true;

Administrator [Syncfusion]
Replied On December 14, 2004 09:10 AM UTC

I am using The problem is I have two such columns whose enabled and readonly property have been set in those ways. But when i cut the contents of one column are not cut but the contents of other column are cut. I am not able to figure out why?

Administrator [Syncfusion]
Replied On December 14, 2004 12:02 PM UTC

Are these special columns, or are both default TextBox columns? Can you post a sample project showing this pronblem, or tell us how to see it in one of our samples?

Administrator [Syncfusion]
Replied On December 15, 2004 08:51 AM UTC

How do i submit a test application?

Administrator [Syncfusion]
Replied On December 15, 2004 08:53 AM UTC

Ok if you set the enbaled property to false and readonly property to true the contents are not cut. Say these properties are set for column 2. Now i cut row 4 and paste the contents on row 5 then the contents of column 2 are also pasted. What i want is the column 2 should not be affected by the paste operation. It should have the value it had before paste was performed.

Administrator [Syncfusion]
Replied On December 15, 2004 09:30 AM UTC

In a GridControl, the default copy/paste support uses styles if they are on the clipboard. Copying and pasting styles will overwrite readonly cells. If you do not want this, there are several ways to handle it. The simplest way is to only support text pasting instead of both style and text pasting. You can do this by turninging a flag in the clipboardflags property. this.gridControl1.CutPaste.ClipboardFlags &= ~GridDragDropFlags.Styles; If you do this, the paste will stop when it comes to a readonly cell. If you want different behavior (like skip the cell and continue with the other cells), then you would handle teh PasteCelltext event. There you would check teh target cell and set e.cancel = true if it is readonly. private void gridControl1_PasteCellText(object sender, GridPasteCellTextEventArgs e) { if(e.Style.ReadOnly) e.Cancel = true; } If you need to paste style information (hence cannot turn off the styles flag as above), then you will have to handle ClipboardPaste and do all the work yourself.

Administrator [Syncfusion]
Replied On December 16, 2004 08:24 AM UTC

Thanks Clay. It worked .


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