troubleshooting Question

Why my ListView Control is not sorted after I added items to it?

Avatar of lapucca
lapucca asked on
C#
4 Comments1 Solution346 ViewsLast Modified:
This Listview control (NodeDetail) is selected to sort Ascending in the designer.  I added some items to the list using code below when the form is loaded but the listing is not softed at all.  How can I get it to sort?  Thanks.

                NodeDetail.Items.Add(new ListViewItem(new string[] { "Successful Kerberos Activity Report",
                "Display successful kerberos activity information." }, 9));
                NodeDetail.Items.Add(new ListViewItem(new string[] { "Failed Kerberos Activity Report",
                "Display failed Kerberos Activity information." }, 9));
                NodeDetail.Items.Add(new ListViewItem(new string[] { "All Kerberos Activity Report",
                "Display all Kerberos Activity information." }, 9));
                NodeDetail.Sort();
                NodeDetail.Refresh();
ASKER CERTIFIED SOLUTION
gena17

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros