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.

Ctrl+C

Thread ID:

Created:

Updated:

Platform:

Replies:

33798 Aug 26,2005 05:54 AM Aug 26,2005 02:17 PM Windows Forms 3
loading
Tags: GridControl
Michael Cruanes
Asked On August 26, 2005 05:54 AM

Hi, I am using GDBG v3.2.1 with ListBoxSelectionMode set to ONE. I am trying to copy the content of a cell, but I am always getting the complete row in the clipboard. How can I set the grid that the content of the selected cell is copied to the clipboard ? Thanks, Michael

Administrator [Syncfusion]
Replied On August 26, 2005 08:00 AM

The default behavior is to copy the selction which is the whole row. If you want some other behavior, then you can try handling the CurrentCellKeyDown event and doing the copy yourself.
private void gridDataBoundGrid1_CurrentCellKeyDown(object sender, KeyEventArgs e)
{
	if(e.KeyCode == Keys.C && (e.Modifiers & Keys.Control) != 0)
	{
		String s = this.gridDataBoundGrid1.CurrentCell.Renderer.ControlText;
		Clipboard.SetDataObject(s);
		e.Handled = true;
	}
}

Michael Cruanes
Replied On August 26, 2005 09:53 AM

Thank you Clay, it works. How can I get the selected text when editing a cell ?

Administrator [Syncfusion]
Replied On August 26, 2005 02:17 PM

Try GridTextBoxCellRenderer cr = this.gridDataBoundGrid1.CurrentCell.Renderer as GridTextBoxCellRenderer; string s = cr.TextBox.SelectedText;

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.

;