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

Problem with paste in a sorted GridGroupingControl

Hi, I am trapping the PasteCellText event of the GridGroupingControl and setting the value for each cell in the source datatable in the event handler. I have a problem when I paste into multiple cells of a column on which the grid has been sorted. The order of values pasted is not preserved. As the values get pasted one by one, the grid moves the modified rows up or down according to the sorting criteria. Because of this the subsequent data gets pasted into wrong cells. Is there a way to avoid this problem? Thanks, Sameer

2 Replies

AD Administrator Syncfusion Team April 5, 2005 10:01 AM

One thing you can do is to cache the target records in their original order in ClipboardPaste. Then in PasteCellText, instaed of working on the records from the grid, retrieve them from the cached records, and set the values on thoses records. This way, the paste will occur as if the grid were fixed for the entire paste operation, and then was sorted after completion of the entire paste. Here is a miinimal sample showing what I mean. http://www.syncfusion.com/Support/user/uploads/GGC_BookMark_2a3ce2d5.zip


SP Sameer Patil April 7, 2005 05:20 AM

Worked fine. Thanks a lot! Sameer >Hi, > I am trapping the PasteCellText event of the GridGroupingControl and setting the value for each cell in the source datatable in the event handler. > I have a problem when I paste into multiple cells of a column on which the grid has been sorted. The order of values pasted is not preserved. As the values get pasted one by one, the grid moves the modified rows up or down according to the sorting criteria. Because of this the subsequent data gets pasted into wrong cells. > Is there a way to avoid this problem? > >Thanks, >Sameer

Loader.
Live Chat Icon For mobile
Up arrow icon