Identifying the source control in drag and drop

3 posts, 1 answers
  1. Michael Hassinger
    Michael Hassinger avatar
    19 posts
    Member since:
    Sep 2009

    Posted 25 Aug 2010 Link to this post

    I have two ListBoxes that I am allowing a user to drag items from onto a GridView. Depending on which ListBox they are dragging from, I need to perform different operations.

    So my question is how do I determine which ListBox control the user is dragging an item from at the time of drop?
  2. Answer
    Tsvyatko
    Admin
    Tsvyatko avatar
    833 posts

    Posted 25 Aug 2010 Link to this post

    Hello Michael Hassinger,

    You could take advantage of the property e.Options.Source which keep track of the source element being dragged (in your case this could be ListBoxItem) and then check which listbox it belongs to. Let me know if you have any questions regarding this scenario.

    Regards,
    Tsvyatko
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Michael Hassinger
    Michael Hassinger avatar
    19 posts
    Member since:
    Sep 2009

    Posted 25 Aug 2010 Link to this post

    Yes, I am able to get to the parent ListBox control name once I create a ListBoxItem and set it to e.Options.Source.

    Thanks!
Back to Top