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

Can cut work like Excel?

Thread ID:

Created:

Updated:

Platform:

Replies:

11915 Mar 18,2004 12:38 AM UTC Mar 18,2004 11:00 AM UTC Windows Forms 1
loading
Tags: GridControl
JianLi
Asked On March 18, 2004 12:38 AM UTC

In Excel, the source text disappear until user paste it. In Syncfusion, the source text disappear immediately when the cut it. How can we make Syncfusion''s Cut working like Excel? Thanks.

Administrator [Syncfusion]
Replied On March 18, 2004 11:00 AM UTC

This will only work if you cut and paste into the same grid (but I think excel has the same behavior). You can catch the grid''s ClipboardCut event, and copy the selections to the clipboard, save the ranges, and then set e.handled so the grid does not try to do its own cutting later. Then you can catch the grid.Model''s ClipboardPasted event, and there clear the saved ranges. //subscribe to the events this.grid.Model.ClipboardPasted += new GridCutPasteEventHandler(grid_ClipboardPasted); this.grid.ClipboardCut += new GridCutPasteEventHandler(grid_ClipboardCut);
private GridRangeInfoList cutRangeList = null;
private void grid_ClipboardCut(object sender, Syncfusion.Windows.Forms.Grid.GridCutPasteEventArgs e)
{
	GridRangeInfoList rangeList = this.grid.Selections.Ranges.Clone();
	if(this.grid.CutPaste.CopyTextToClipboard(rangeList))
	{
		cutRangeList = rangeList.Clone();
		e.Handled = true;
		e.Result = true;
	}
}
private void grid_ClipboardPasted(object sender, Syncfusion.Windows.Forms.Grid.GridCutPasteEventArgs e)
{
	if(cutRangeList != null && cutRangeList.Count > 0)
	{
		this.grid.ClearCells(cutRangeList, false);
	}
	cutRangeList = null;
}

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.

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

;