Results 1 to 2 of 2

Thread: Programatically select item in listview

  1. #1

    Thread Starter
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536

    Programatically select item in listview

    I have a ListView with 100 items in it. When the user clicks a button I want the ListView to redraw with item 50 at the top. How can I do this?



    Background:

    The above is just an abstract of what I'm trying to do. The real problem is that I've got a variable length list. The user can click on an item in the list and either delete it or change the name of the item. When they have done this my code stores their changes and reloads the list. I want the list to scroll to the item they have just edited (or the item just before the one they deleted).
    This world is not my home. I'm just passing through.

  2. #2

    Thread Starter
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536

    [RESOLVED]

    There is a method on the ListView called EnsureVisible(Index).

    If you know the index of the item that you want to be shown then you can use this.
    This world is not my home. I'm just passing through.

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