Results 1 to 2 of 2

Thread: Moving the selected item in Listview

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 1999
    Location
    Memphis, TN, USA
    Posts
    14

    Post

    ****
    I solved the problem, thanks to all for your attempt at helping.

    Here is the code:

    Set ListView.SelectedItem = ListView.ListItems(i)
    ****

    I have a Listview populating from a database and sorts the data alphabetically.

    Now when the user deletes an item from the database, it also refreshes the listview.

    The question I have is, the listview always sets focus to the last item it added, however it does not add them alphabetically, so after there added and the listveiw sorts them, the item selected could be anywhere!? How can I have this list view set focus to the first entry? Or better yet one that I specify or has been saved (IE save the record ID when they exit the prog, so when they come back I can pull that and set focus to that item)??

    Thanks for the help.
    Bryan

    [This message has been edited by Bryan (edited 01-12-2000).]

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    Set focus to the first entry: List1.Selected(0) = True

    If you want to save a specific value and select it later, save the value, resort the listbox, and search thru the listbox and select the matching item

    HTH

    Tom

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width