RadListBox Drag Drop and Scroll Bars

2 posts, 1 answers
  1. TJ
    TJ avatar
    1 posts
    Member since:
    May 2010

    Posted 12 Apr 2012 Link to this post

    I am implementing drag and drop operations between 2 radlistboxes based on the demo with the DragDropManager...
    The implementation works fine but i run into a problem when there are more items in the list than the visible area...
    specifically getting the upperbound of the visualitem
    source code from demo is...

    int UpperBound = visualReplacedItem.Bounds.Height * this.targetListBox.Items.IndexOf(this.replacedItem);

    the problem is the second part (index of) could return a large number when a list contains 200 items causing the feedback form to draw off the visible area...

    is there a visualitems index or something i can reference instead to keep the feedback form in the visible area of the RadListBox?

    My feel is that even the demo would not work properly if the lists contained enough items to cause scrolling...
  2. Answer
    Peter avatar
    1160 posts

    Posted 17 Apr 2012 Link to this post

    Hi TJ,

    Thank you for contacting Telerik support.

    I would like to clarify that this example does not support scrolling. You can modify the problematic line of code to search only in visible items:
    int UpperBound = 0;
    if( replacedItem.VisualItem!=null)
                    UpperBound = visualReplacedItem.Bounds.Height * targetListBox.ListElement.ViewElement.Children.IndexOf(replacedItem.VisualItem);

    I hope this helps. Do not hesitate to contact us if you have other questions.

    Kind regards,
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Back to Top