I'd like to show a listview in a C# application where every row represents a product so the property "view" is set on "detail". One column (the last one) should be a checkbox because it represents if the product is discountinued.

With the checkboxes property set to true, a checkbox appear in the first column so it doesn't work for my application.

How can add the checkbox to the last column? Thank you

  • Have you resolved your problems?– TaWJul 19 '17 at 11:01

The Checkboxes are always associated with the first Column. However you change re-order the display of the Columns.

All you need to do it go to the Columns designer and set the 1st colum's DisplayIndex to the last column's index.

enter image description here

Or do it in code:

listView1.Columns[0].DisplayIndex=listView1.Columns.Count - 1;listView1.Invalidate();

Note the Invalidate which is necessary to enforce the display of the new layout..

    Your Answer

     
    discard

    By posting your answer, you agree to the privacy policy and terms of service.

    Not the answer you're looking for? Browse other questions tagged or ask your own question.