I have a strange issue with the ultra list box control where the second time you double click on it, it jumps to the top and selects the wrong item. I created an example app attached to illustrate the issue.
Steps to re-create.
1) Scroll the left hand list box about half way down and double click a row. A short bit of code will run that removes that item from the first box and places it on the second box.
2) Click into the second list box so the first box loses focus.
3) Without scrolling immediately double click an item in the left list, you will notice it puts across the wrong item, picking instead one of the first ones in the list.
This is confusing the heck out of our users in our real app. Any way to stop it jumping to the top? We are having to tell them to single click first, wait half a second then double click.
Thanks,
Alex
What you can do is set the ActiveItem right after removing:
Private Sub UltraListView1_ItemDoubleClick(sender As Object, e As Infragistics.Win.UltraWinListView.ItemDoubleClickEventArgs) Handles UltraListView1.ItemDoubleClick If e.Item.Tag = 0 Then Dim index = e.Item.Index
UltraListView1.Items.RemoveAt(e.Item.Index)
If index >= 0 And index < UltraListView1.Items.Count Then UltraListView1.ActiveItem = UltraListView1.Items(index) End If
End If 'Insert the new item at the last postion. UltraListView2.Items.Insert(UltraListView2.Items.Count, e.Item) End Sub
Thanks, I had tried something like that but I think my issue was I had not gathered the original index, but your code works a treat.