ListView Control

Posted on 2012-09-21
Last Modified: 2012-10-03
Hi Experts,

I have a listview control on a WinForm with ten columns. I added one more column moved it to the correct position in the columns list and set the display indexes of all columns to put it in the correct place but it still displays as the last column instead of the required fourth.

In the Design View it displays in the correct position but when the Form is run it displays as the last column.
Question by:DColin
    LVL 11

    Expert Comment

    try to close the application and reopen.

    Author Comment

    Hi rajvja,

    It is the same.

    When I test the contents of the columns at run time they are as the display index with my new column at index 3 but it displays as the end column.
    LVL 83

    Expert Comment

    Do you have any code anywhere else which sets the indices?

    Author Comment

    Hi CodeCruiser,

    I do not set the indices anywhere in my code. The columns were defined in the control's properties window at design time.
    LVL 83

    Accepted Solution

    I just tried it myself and if I change the DisplayIndex of columns in design mode then it works for me in both design view and at runtime.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    In my previous article ( we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    759 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

    11 Experts available now in Live!

    Get 1:1 Help Now