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

Show Selected Range after Pasting Data

In a GDBG, if I copy data from a range of cells, click a new cell and then select paste, I would like to show the entire pasted range as selected (Currently, after pasting, only the first cell in the range is selected). How can I achieve this? Thanks, Jeff

1 Reply

AD Administrator Syncfusion Team February 9, 2005 06:09 PM

I think you need to handle the ClipboardPaste event. In that event you can call Model.CutPaste.Paste() to paste the contents from the clipboard. After that set e.Handled = true; bool inPaste = false; private void gridControl1_ClipboardPaste(object sender, GridCutPasteEventArgs e) { if (inPaste) return; inPaste = true; gridControl1.Model.CutPaste.Paste(); // now select the range of cells // I suggest calling Model.TextDataExchange.CalcBufferDimension(string psz, out int nRows, out int nCols) wheras psz should be the data from e.DataObject (buffer = iData.GetData(DataFormats.Text) as string) // then call Selections.SelectRange(range, true); e.Handled = true; inPaste = false; } Stefan >In a GDBG, if I copy data from a range of cells, click a new cell and then select paste, I would like to show the entire pasted range as selected (Currently, after pasting, only the first cell in the range is selected). How can I achieve this? > >Thanks, >Jeff

Loader.
Live Chat Icon For mobile
Up arrow icon