Rashar

Hello,

How can I resize specific column widths in a DataGridView Control

Here is the code that populates my datagridview control...

da.Fill(ds, "qryExp_Rpt_List_VB")

ds.Locale = System.Globalization.CultureInfo.CurrentUICulture

'DISPLAY DATASET TO DATAGRIDVIEW1

DataGridView1.DataSource = ds

DataGridView1.DataMember = "qryExp_Rpt_List_VB"

DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells

DataGridView1.ColumnHeadersVisible = False

In the old version of VB, I could resize individual columns in a listbox or grid by placing values in the Column Width Property as such: 0.2";1.5";0.5";0.5";0.5";0.5"

With Visual studio 2005 / VB.Net, I do not see the Column Widths property for the DataGridView...

Any suggestions is greatly apprciated.

Thanks



Re: Visual Basic Express Edition How to resize specific column widths in DataGridView Control?

Paul Domag

Hi,

Just access the columns collection, select the index and change the width property:

dataGridView1.Columns[0].Width = 500;

dataGridView1.Columns["Field1"].Width = 500;

cheers,

Paul June A. Domag