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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Ctrl+C

Thread ID:

Created:

Updated:

Platform:

Replies:

33798 Aug 26,2005 09:54 AM UTC Aug 26,2005 06:17 PM UTC WinForms 3
loading
Tags: GridControl
Michael Cruanes
Asked On August 26, 2005 09:54 AM UTC

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 12:00 PM UTC

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 01:53 PM UTC

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

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

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.

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

;