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.

Copy paste Problem in Clipboard

Thread ID:

Created:

Updated:

Platform:

Replies:

42591 Apr 3,2006 03:18 AM Apr 4,2006 08:11 AM Windows Forms 5
loading
Tags: GridControl
Vijay
Asked On April 3, 2006 03:18 AM

I want to Copy a single cell or multiple cell values of noneditable gridcontrol which has some leading spaces. Note:The problem that persisted right now was the leading spaces values are truncated and saved in a notepad. Code snippet looks like..: GridRangeInfo range = GridRangeInfo.Cell(this._lastSelectedRow, this._lastSelectedColumn); _gridControl.Selections.Add(range); _gridControl.CutPaste.CopyTextToClipboard(_gridControl.Selections.Ranges);

Administrator [Syncfusion]
Replied On April 3, 2006 08:50 AM

Hi Vijay, This can be achieved by using the ClipboardCopy event. In the event, get the range and the data for each cell in the range and set manually to the DataObject. Refer to the sample for more details. Sample : LeadingSpace_ClipboardCopy Best regards, Madhan

Vijay
Replied On April 3, 2006 10:53 AM

Hi Madhan, Thanks for your kindly help. How about if selection done for multiple cell clipboard copy? My Sample code looks. public void CopySelectedCellsToClipboard () { GridRangeInfoList rangeList = _gridControl.Selections.Ranges; if ( (rangeList.GetColRanges (GridRangeInfoType.Cells|GridRangeInfoType.Rows).Count != rangeList.Count) || (rangeList.GetRowRanges (GridRangeInfoType.Cells|GridRangeInfoType.Cols).Count != rangeList.Count)) { for (int i = 0; i < rangeList.Count; i++) { if (rangeList[i].IsRows ) { GridRangeInfo rangeInfo1 = rangeList[i]; GridRangeInfo rangeInfo = GridRangeInfo.Cells (rangeList[i].Top,1, rangeList[i].Bottom, _gridControl.ColCount); rangeList[i]= rangeInfo; } else if (rangeList[i].IsCols ) { GridRangeInfo rangeInfo = GridRangeInfo.Cells (1,rangeList[i].Left, _gridControl.RowCount, rangeList[i].Right ); rangeList[i]= rangeInfo; } } } if(rangeList.Count==0) { GridRangeInfo range = GridRangeInfo.Cell(this._lastSelectedRow, this._lastSelectedColumn); _gridControl.Selections.Add(range); } _gridControl.CutPaste.CopyTextToClipboard(_gridControl.Selections.Ranges); } Regards Vijay.T >Hi Vijay, > >This can be achieved by using the ClipboardCopy event. In the event, get the range and the data for each cell in the range and set manually to the DataObject. Refer to the sample for more details. > >Sample : LeadingSpace_ClipboardCopy > >Best regards, >Madhan

Administrator [Syncfusion]
Replied On April 4, 2006 01:01 AM

Hi Vijay, You can replace the CopyTextToClipboard( ) method with the code snippet provided in the sample. Here is the modified sample. Sample : Modified Sample Best regards, Madhan

Vijay
Replied On April 4, 2006 01:45 AM

Hi Madhan, Thanks a lot. Regards, Vijay.T >Hi Vijay, > >You can replace the CopyTextToClipboard( ) method with the code snippet provided in the sample. Here is the modified sample. > >Sample : Modified Sample > >Best regards, >Madhan >

Administrator [Syncfusion]
Replied On April 4, 2006 08:11 AM

Hi Vijay, Here is the updated sample. Sample : LeadingSpace_ClipboardCopy.zip Best regards, Madhan

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.

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.

;