Drag and Drop within RadGridView - error with DataView as ItemSource

3 posts, 0 answers
  1. Insight
    Insight avatar
    5 posts
    Member since:
    Sep 2012

    Posted 15 Sep 2012 Link to this post

    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. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 17 Sep 2012 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Insight
    Insight avatar
    5 posts
    Member since:
    Sep 2012

    Posted 18 Sep 2012 Link to this post

    Thanks.
Back to Top