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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

multiple copy in GDBG

Thread ID:

Created:

Updated:

Platform:

Replies:

52025 Nov 20,2006 08:55 PM UTC Nov 29,2006 08:44 AM UTC WinForms 5
loading
Tags: GridControl
Charlie Mao
Asked On November 20, 2006 08:55 PM UTC

Hey, I was wondering if anyone knows how to be able to select multiple rows and copy that to another databound grid. I have two grids with the same datasource. What I want to be able to do is select multiple rows, hit a copy to button and it will copy the rows I selected from one grid to the exact rows of another grid. A sample would be really helpful. Please let me know if you need clarification. Thanks..

Charlie

Administrator [Syncfusion]
Replied On November 21, 2006 12:16 PM UTC

Hi Charlie,

You can use the Model.CutPaste property to manages the cut/copy/paste functionality in a grid. The following code states how to copy/paste the selected cells in a grid.

//Copy the cells.
GridRangeInfoList rSelectedRange = this.gridDataBoundGrid1.Model.SelectedRanges;
this.gridDataBoundGrid1.Model.CutPaste.CopyRange(rSelectedRange);

//Paste to the cell
this.gridDataBoundGrid1.Model.CutPaste.Paste();

Please refer to the attachment for implementation.
http://www.syncfusion.com/Support/user/uploads/multicopy_c6ed6791.zip

Best Regards,
Haneef

Charlie Mao
Replied On November 25, 2006 12:10 AM UTC

Hey Haneef,

I couldnt get the sample that you provided to work. I tried highlighting a few rows in one grid clock copy and then click on the other grid and hit paste and it didnt do anything. This could be me not using this right. I had one question. Could this sample be modified to hit a "copy to second grid" button and it automatically copies the rows to the other grid.Thanks for your help. I hope you had a great thanksgiving.

Charlie

Administrator [Syncfusion]
Replied On November 27, 2006 09:50 AM UTC

Hi Charlie,

Thanks for the update.

Please try the attached sample and let me know if this helps.
MultipleCopy.zip

Best Regards,
Haneef

Charlie Mao
Replied On November 28, 2006 08:41 PM UTC

Hey Haneef,

The sample you gave me was awesome. It works perfectly. But for some reason, when I try it on my project it doesnt work. I checked the sClipBoardObj variable and it contains the right data and it is detecting my selected rows correctly, but for some reason, it doesnt paste on my other data grid. Is there something that I just missed? My second data grid is on another tab page. Does this matter? I changed the call to CopyToGrid(this.dataGridA,this.dataGridB); which are the names of my datagrid. Thanks for your help. I look forward to your response.

Charlie

Administrator [Syncfusion]
Replied On November 29, 2006 08:44 AM UTC

Hi Charlie,

The attached sample shows you How to copy the data from one grid to another grid using Model.CutPaste property. It also implements the system.Windows.TabControl. Please refer to the attached sample for implementation and let me know if this helps.

Sample : ModifiedMultipleCopy.zip

Best Regards,
Haneef

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.

Warning Icon 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.Close Icon

;