[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

VB.NET ListView - Select first item

Posted on 2002-06-27
2
Medium Priority
?
1,408 Views
Last Modified: 2007-12-19
Anybody knows how to select the first top item displayed on a listview once sorted by alpha without having to loop through all the items and compare again?

note: ListView1.Items(0).Selected won't work here...
0
Comment
Question by:ourman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
DarthPedro earned 75 total points
ID: 7114584
Why won't that line of code work?  I just tried it, and it seemed to do the job.  I started by adding a list of items into the ListView.  Then sorting them when the column header was clicked, like this:

    private void listView1_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
    {
        listView1.Sorting = SortOrder.Ascending;
        listView1.Items[0].Selected = true;
    }

The first item in the sorted list was selected...
0
 

Author Comment

by:ourman
ID: 7116347
A typical idiot's question: I was selecting the item before sorting the listview.
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

656 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