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. Image for the cookie policy date
close icon

Clipboard Paste

Hi,

I pasted two columns in the grid and in the savecellinfo I'm trying to save the value in the document.

If I use
GridCurrentCell currentCell = CurrentCell;
m_document[e.RowIndex - 2, currentCell.ColIndex] = e.Style.CellValue;
the first column is overwritten by the second column.

if I use
m_document[e.RowIndex - 2, e.ColIndex] = e.Style.CellValue;

Rows count is incresing but the grid is empty.

Please help me out.

Thanks & Regards,
Sathish.

3 Replies

AD Administrator Syncfusion Team February 27, 2007 10:44 PM UTC

Hi Sathish,

There is a property flag that controls whether or not rows/columns can be appended during a paste.

[C#]
this.gridControl1.CutPaste.ClipboardFlags |= (GridDragDropFlags.NoAppendCols | GridDragDropFlags.NoAppendRows);

Best regards,
Haneef


SC Sathish Chandran March 1, 2007 10:30 AM UTC

Hi Haneef,

Thanks for your information.

I'm trying to paste two columns in the grid. When I paste, I'm getting e.colIndex as 0.
But when I edit the cell, I'm getting the exact e.ColIndex.
When I paste a value in the cell, I need to get the exact colIndex.

I'm doing this functionality in the savecellinfo.

Please help me out.
Thanks & Regards,
Sathish.

>Hi Sathish,

There is a property flag that controls whether or not rows/columns can be appended during a paste.

[C#]
this.gridControl1.CutPaste.ClipboardFlags |= (GridDragDropFlags.NoAppendCols | GridDragDropFlags.NoAppendRows);

Best regards,
Haneef


AD Administrator Syncfusion Team March 1, 2007 11:03 PM UTC

Hi Sathish,

To detect the cell information when pasting done in a cell, you need to handle the PasteCellText event of the grid and also you can turn off support for copying styles (allowing only text to be pasted and PasteCellText to be hit). To turn off style copy/paste support in a gridcontrol, turn off this flag.

this.gridControl1.Model.CutPaste.ClipboardFlags &= ~GridDragDropFlags.Styles;

this.gridControl1.Model.PasteCellText += new GridPasteCellTextEventHandler(Model_PasteCellText);
void Model_PasteCellText(object sender, GridPasteCellTextEventArgs e)
{
Console.WriteLine(e.RowIndex + ":::" + e.ColIndex);
}

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon