How can I always show the last item in the Listview?

Posted on 2009-04-22
Last Modified: 2012-05-06
Question by:xewoox
    LVL 9

    Expert Comment

    by:Sreedhar Vengala
    something as : lstBox.SelectedIndex = lstBox.Items.Count - 1
    LVL 29

    Expert Comment

    Selection is one way. Sometimes selection is not the besr option.
    Another wayI's say more proper way:

     ListViewItem lvi = ListView1.Items[ListView1.Items.count-1);
    lvi.EnsureVisible ();

    Accepted Solution

    lstBox.SelectedIndex = lstBox.Items.Count - 1 - This does not work

    lvi.EnsureVisible (); - no such function in C# WPF
    LVL 29

    Expert Comment

    xewoox, just a comment - you never told your question was related to WPF. You have to be more specific in your questions so people don't waist their time.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Hire Top Freelancers to Complete C# Projects

    Source the talented Expert Exchange community
    for top quality work on your C# projects.

    Hire the best. Collaborate easily. Get quality work.

    In one of my recent projects, I was working with IP cameras, I need to take some pictures from the camera and do some processing on it. The first step, was to retrieve the image from camera into Image object. So that it can be displayed or …
    Article by: Najam
    Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now