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

RadListBox Drag Drop and Scroll Bars

1 Answer 83 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
TJ
Top achievements
Rank 1
TJ asked on 12 Apr 2012, 02:50 PM
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...

1 Answer, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 17 Apr 2012, 03:08 PM
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,
Peter
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Tags
DropDownList
Asked by
TJ
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or