ListView column width does not obey the width setting

BenTam 1,661 Reputation points
2023-09-08T04:14:27.5233333+00:00

Dear All,

ListView column width does not obey the width setting as shown in the following screen captures. Can anybody help me solve this problem?

I set the width of the date column to 426.

ColumnEditor

The form in runtime.

Student

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,830 questions
{count} votes

Accepted answer
  1. Jiale Xue - MSFT 44,321 Reputation points Microsoft Vendor
    2023-09-08T08:01:59.8066667+00:00

    Hi @BenTam-3003 , Welcome to Microsoft Q&A,

    After my test,

    You probably have adaptive width enabled somewhere.

    For example:

     listView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
    

    It is very likely that you made the listview adaptive to the matrix.

    enter image description here

    try setting it manually

    listView.Columns[0].Width = 465;
    

    This way it turns off autoresize。

    Best Regards,

    Jiale


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.