Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2145
Ultralistview jumps to top on double click
posted

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

Listboxtest.zip
Parents
No Data
Reply
  • 69832
    Verified Answer
    Offline posted

    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

Children