在运行时设置DataGridView列的宽度

问题描述:

你好,

在程序中,我需要在运行时更改DataGridView的每列的宽度.您可以通过编写代码段让我知道吗?

非常感谢您

Hello,

In a program I need to change the width of each columns of DataGridView at run time. Could you please let me know by writing the code snippet?

Thank you very much

这非常困难-您确定要这样做吗?
It''s horribly difficult - are you sure you want to do this?
dataGridView1.Columns[0].Width = 50;
dataGridView1.Columns[1].Width = 150;