AD
Administrator
Syncfusion Team
November 7, 2006 10:50 AM UTC
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();
if(data.GetDataPresent(DataFormats.Text))
{
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,
Haneef
CL
Christian Lützenkirchen
November 7, 2006 01:26 PM UTC
Hi Haneef,
it works fine. Thank you for your help.
Best Regards,
Christian