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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GDBD Cut/Copy restriction

Thread ID:

Created:

Updated:

Platform:

Replies:

36490 Nov 1,2005 03:22 PM UTC Nov 1,2005 04:16 PM UTC WinForms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On November 1, 2005 03:22 PM UTC

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 03:41 PM UTC

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 03:59 PM UTC

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 04:16 PM UTC

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.

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

;