Vb.net 如何在VB中增加DataGrid的列宽度

Vb.net 如何在VB中增加DataGrid的列宽度,vb.net,Vb.net,我在VB中使用DataGrid控件。 我在运行时创建了一个DataTable,并在此DataTable中添加了5列。 我用DataGrid控件绑定了数据表 数据网格的宽度为880。 DataGrid中5列数据表的默认宽度为100。因此,对于5列,使用的宽度=500。因此,在DataGrid的右侧cornor左边有一个380的空白空间。我想用这5列来填补这个空白。我想增加列的宽度,以便在DataGrid中完全覆盖它。查看属性 DataGrid1.PreferredColumnWidth = 176

我在VB中使用DataGrid控件。 我在运行时创建了一个DataTable,并在此DataTable中添加了5列。 我用DataGrid控件绑定了数据表

数据网格的宽度为880。 DataGrid中5列数据表的默认宽度为100。因此,对于5列,使用的宽度=500。因此,在DataGrid的右侧cornor左边有一个380的空白空间。我想用这5列来填补这个空白。我想增加列的宽度,以便在DataGrid中完全覆盖它。

查看属性

DataGrid1.PreferredColumnWidth = 176
在这种情况下,176是880/5

但是,如果列中的数据超过176,则该值可能会被覆盖

您可能还想看看: