DataGridView - how to set column width?

后端 未结 13 2268
情书的邮戳
情书的邮戳 2020-12-13 23:58

I have a WinForms application with DataGridView control. My control has five columns (say \"Name\", \"Address\", \"Phone\" etc)

I am not happy with defa

13条回答
  •  时光说笑
    2020-12-14 00:55

    The following also can be tried:

    DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells
    

    or use the other setting options in the DataGridViewAutoSizeColumnsMode Enum

提交回复
热议问题