This is a migrated thread and some comments may be shown as answers.

GridView exception on pasting from excel

12 Answers 104 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Alexander
Top achievements
Rank 1
Alexander asked on 27 Jul 2011, 05:04 PM
Hi, guys.

I have a big problem with pasting data in to the grid.
I have a grid in my app with 5 rows for example. When i'm trying to paste more than 5 rows, I expect the new rows in the grid to appear.
But I get just an exception: "Cell is already in the collection" Parameter name: cellInfo

You can find the sample project here
Thanks.

12 Answers, 1 is accepted

Sort by
0
Alexander
Top achievements
Rank 1
answered on 27 Jul 2011, 06:30 PM
It's in the GridDataContro.PerformPaste method.
Looks like the problem is here:
IEnumerable<GridViewCellInfo> items = this.InsertFromClipboardValuesCollection(values, upperLeftCellLocation, rightBoundary);
0
Alexander
Top achievements
Rank 1
answered on 28 Jul 2011, 03:01 PM

Any update on this?

0
Vlad
Telerik team
answered on 28 Jul 2011, 03:15 PM
Hi,

 Can you post more info about your grid version? I've checked your account however you do not have any downloads. 

Kind regards,
Vlad
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Alexander
Top achievements
Rank 1
answered on 28 Jul 2011, 03:30 PM
Hi, Vlad.
Thanks for answering. It's Q2 2011.

You can download demo project from the link in the opening post.
0
Milan
Telerik team
answered on 03 Aug 2011, 08:52 AM
Hello Alexander,

 We have isolated the issue and we currently working on a fix. For the time being you could try setting IsSynchronizedWithCurrentItem of RadGridView to false - this should take care of the problem. 

I have updated your Telerik points.

Kind regards,
Milan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Milan
Telerik team
answered on 03 Aug 2011, 03:32 PM
Hi Alexander,

The bug is now resolved and the fix will be available in the next Internal Build. 

Regards,
Milan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Alexander
Top achievements
Rank 1
answered on 03 Aug 2011, 05:12 PM
Thank you, guys.
0
Dominik
Top achievements
Rank 1
answered on 12 Sep 2011, 10:05 AM
Hi

When will this build be released?

Greetings

0
Vlad
Telerik team
answered on 12 Sep 2011, 12:15 PM
Hello,

 You can check our latest internal build. 

All the best,
Vlad
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Darrick
Top achievements
Rank 1
answered on 14 Sep 2011, 03:43 PM
I'm using the latest build: 2011.2.0912.4 (WPF).  I was having the same issue and now its fixed; partially.  I have a question on what gets kept in the Clipboard after a paste.  For instance, if I copy two rows from my grid and then select the last row and paste, I get what I expect (the first row copies over the last row and a new row is inserted with the values of the seconded copied row).  If I select and copy another two rows and do a paste, if you look at the clipboard (by stopping in the RadGrid's Pasting event), the contents will contain the rows I just copied and the row I previously pasted over.  Doing a paste will now paste 3 rows.  Continuing down this path gets worse and the grid starts to get confused.

A work around, at least for my application, was to capture the number of rows selected in the Copying event.  And in the Copied event, strip out the count of those items from the Clipboard, clear the Clipboard and then replace the selected content.
0
Darrick
Top achievements
Rank 1
answered on 14 Sep 2011, 04:11 PM
Additional info...After pasting at the bottom of the grid...the visually selected row is the last added row.  However, the previously selected cell/row is still selected where the paste began.  This causes issues if you try to paste multiple times in a row.
0
Vera
Telerik team
answered on 16 Sep 2011, 03:39 PM
Hi Darrick,

Thank you for reporting these issues.
We succeeded to reproduce the first problem. We will address it in the future Internal Builds.

As for the second problem could you please give some more information or modify the attached project in order to reproduce it? In case you want to send the project back you have to open a new support ticket.

I have updated your telerik points accordingly.

Kind regards,
Vera
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
GridView
Asked by
Alexander
Top achievements
Rank 1
Answers by
Alexander
Top achievements
Rank 1
Vlad
Telerik team
Milan
Telerik team
Dominik
Top achievements
Rank 1
Darrick
Top achievements
Rank 1
Vera
Telerik team
Share this question
or