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.

HowTo paste multiline text in richtext cell

Thread ID:





51497 Nov 7,2006 05:11 AM Nov 7,2006 08:26 AM Windows Forms 2
Tags: GridControl
Christian Lützenkirchen
Asked On November 7, 2006 05:11 AM


I want to paste multiline text from the clipboard into a single richtext cell of a GridControl. I took the RichTextCells sample from In Notepad I wrote a text with four lines and copied it into the clipboard.
In the GridControl I marked the cell A3:E3 without dropdown. Then I pressed CTRL+V. The text is written in Cells A3, A4, A5 and A6.
How can I configure the grid that all multiline text is written in A3?


Administrator [Syncfusion]
Replied On November 7, 2006 05:50 AM

Hi Christian,

You can handle the ClipBoardPaste event and can control the pasting yourself. Here is a code snippet to paste multiline text in a richtext cell.

private void grid_ClipboardPaste(object sender, Syncfusion.Windows.Forms.Grid.GridCutPasteEventArgs e)
DataObject data = (DataObject) Clipboard.GetDataObject();
GridControl grid = this.gridControl1 as GridControl;
GridCurrentCell cc = grid.CurrentCell;
if( cc != null
&& cc.Renderer != null
&& cc.Renderer.CurrentStyle.CellType == "RichText")
string s = (string)data.GetData(DataFormats.Text);
grid.Model[cc.RowIndex,cc.ColIndex].Text = s;
e.Handled = true;

Best Regards,

Christian Lützenkirchen
Replied On November 7, 2006 08:26 AM

Hi Haneef,

it works fine. Thank you for your help.

Best Regards,


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.