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.

CutPaste Problem

Thread ID:

Created:

Updated:

Platform:

Replies:

76808 Sep 24,2008 11:20 PM Sep 26,2008 02:33 AM Windows Forms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On September 24, 2008 11:20 PM

Hi All:

I have a problem to use GridControl.CutPaste.

In my program , I must write it a rule to Grid CutPaste , and unable user to copy outside data to paste in Grid .

If I set
Me.Model.CutPaste.ClipboardFlags = 0

And my CutPaste way can't working at the same time .

How can I do CutPaste in my way , and user cnt't Paste data to grid from otherwise .

Think for any help.

Best Regards,
Quenton.




Jisha Joy [Syncfusion]
Replied On September 25, 2008 05:39 AM

Hi Quenton,


The method Model.CutPaste.Paste() will paste whatever data you got in the Clipboard. If you set Clipboard flags to 0, it will not allow pasting into cell.

Please let me know if you have any further questions.

Regards,
Jisha


Administrator [Syncfusion]
Replied On September 25, 2008 08:20 AM

Hi Jisha :

Thanks for your respond .

And my problem is how can I limit user using cut and paste "only" in Grid .

ex:
I write a button to let user can cut and paste data in grid .

And I wnat user can't cut data "form other place" to "paste into grid" .

Is any method can do that ?


By the way I have another question is :

The GridControl.ResizeColsBehavior can stop user to draw Grid Column width .

And how to limit only "1" Column can't draw ?


Best Regards,
Quenton.






Jisha Joy [Syncfusion]
Replied On September 26, 2008 02:33 AM

Hi Quenton,

Issue 1:


This can be achieved by handling the PasteCellText event and canceling it. If you copy some text from Excel and paste it into the grid, then the PasteCellText event will be hit.

this.gridControl1.PasteCellText += new Syncfusion.Windows.Forms.Grid.GridPasteCellTextEventHandler(gridControl1_PasteCellText);


void gridControl1_PasteCellText(object sender, Syncfusion.Windows.Forms.Grid.GridPasteCellTextEventArgs e)
{

e.Cancel = true;
}

Issue 2:

If your intension is to prevent resizing of particular column, this can be achieved by handling the ResizingColumns event. Please refer the code:

this.gridControl1.ResizingColumns += new Syncfusion.Windows.Forms.Grid.GridResizingColumnsEventHandler(gridControl1_ResizingColumns);


void gridControl1_ResizingColumns(object sender, Syncfusion.Windows.Forms.Grid.GridResizingColumnsEventArgs e)
{

if (e.Columns.Left==2 )//Column2
e.Cancel = true;

}

Please try this and let me know if this helps.

Regards,
Jisha


CONFIRMATION

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.

;