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

Drag and Drop within RadGridView - error with DataView as ItemSource

2 Answers 37 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Insight
Top achievements
Rank 1
Insight asked on 15 Sep 2012, 07:57 PM
I follow the example in the WPF Control Examples application and Telerik website http://www.telerik.com/help/wpf/raddraganddrop-within-radgridview.html . I was able to make it work with the sample "MessageViewModel" as the RadGridView.ItemSource. However, when I change the RadGridView.ItemSource to DataView (data is retreiving from DB as DataTable), I got error "Cannot insert external objects to this list." at line:

((sender 

as RadGridView).ItemsSource as IList).Insert(index, draggedItem);

Does this feature work with DataView as ItemSource? How do I need to change to make it work?

Thanks

 

2 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 17 Sep 2012, 07:10 AM
Hello,

If the ItemsSource is DataView, then you should cast it appropriately and insert a new item to the DataView.

Kind regards,
Didie
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Insight
Top achievements
Rank 1
answered on 18 Sep 2012, 05:13 PM
Thanks.
Tags
DragAndDrop
Asked by
Insight
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Insight
Top achievements
Rank 1
Share this question
or