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.

GDBD Cut/Copy restriction

Thread ID:

Created:

Updated:

Platform:

Replies:

36490 Nov 1,2005 10:22 AM Nov 1,2005 11:16 AM Windows Forms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On November 1, 2005 10:22 AM

I have a row selected in the GDBD and the grid''s ActivateCurrentCellBehavior is set to GridCellActivateAction.SelectAll. I only want the current cell contents to copied or pasted. Thanks, Sri

Administrator [Syncfusion]
Replied On November 1, 2005 10:41 AM

Try handling the grid.Model.ClipboardCopy event and in your handler, put teh currentcell text onto the clipboard.
private void Model_ClipboardCopy(object sender, GridCutPasteEventArgs e)
{
	Clipboard.SetDataObject(this.gridDataBoundGrid1.CurrentCell.Renderer.ControlText);
	e.Handled = true;
	e.Result = true;
}

Administrator [Syncfusion]
Replied On November 1, 2005 10:59 AM

Clay, Thanks a lot for the help. Your suggestion worked but only for copy. when i use ctrl+x to cut it just copied but did not clear the contents of the cell. Do we need to do this manually? I hooked both Model_ClipboardCopy and Model_ClipboardCut to the handler you suggested. Thanks, Sri >Try handling the grid.Model.ClipboardCopy event and in your handler, put teh currentcell text onto the clipboard. >
>private void Model_ClipboardCopy(object sender, GridCutPasteEventArgs e)
>{
>	Clipboard.SetDataObject(this.gridDataBoundGrid1.CurrentCell.Renderer.ControlText);
>	e.Handled = true;
>	e.Result = true;
>}
>

Administrator [Syncfusion]
Replied On November 1, 2005 11:16 AM

Try this handler for cut.
private void Model_ClipboardCut(object sender, GridCutPasteEventArgs e)
{
	Clipboard.SetDataObject(this.gridDataBoundGrid1.CurrentCell.Renderer.ControlText);
	e.Handled = true;
	e.Result = true;
	this.gridDataBoundGrid1.CurrentCell.Renderer.ControlText = "";
}

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.

;