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
85
How do I programmatically move the top item in the list?
posted

Hello-

 I am using the UltraListView in my application. I am executing a method that first populates the list with all the files in a particular folder. I am then executing another method that goes through all of the items in the list, and does certain things with them (ie, back them up).

I am going through with a for loop, and using SelectedItems.Clear and SelectedItems.Add to select the current file I am working on in this list view. It works great, the bar goes through all of the items and selects them one by one (basically highlighting them showing the user "hey, i'm backing up this file right now). 

The only problem that I have is when I used the SelectedItems.Add method, it does not move that selected item to the top of the list (or even put it in view when there are scrollbars on the list (lots of items).

I want to be able to select an item, and then force the control to make that selected item visible in the list (move it to the top, or even the bottom, as long as it is selected and in plain view of the user).

 

Any help would be appreciated!

Parents
  • 85
    posted

    I have since discovered the BringIntoView method. That seems to work, somewhat. The current item will come into view (on the bottom of the list) however, it does not show "hi lighted" as it was selected. The only way I can get it to show as highlighted is if I grab the slider and move way down so its not visible, and then come back to it.

     The same happens when I programmatically set an item with a button click event. Example: ultraListView1.SelectedItems.Add(ultraListView1.Items[0]);

    When I click the button, nothing happens. You do not see the item appear hi lighted in the list. However, if I grab the scrollbar slider and move way down so that item number 0 (first) is not visible, and then back up, it updates and shows it as hi lighted.

    I tried using Refresh and Update but that doesn't seem to work.

    heh, wordy tonight I know, blame the vodka and R&D lol

Reply Children
No Data