all groups > asp.net datagrid control > january 2008 >
You're in the

asp.net datagrid control

group:

Re : Very simple question, columns width


Re : Very simple question, columns width BB206
1/7/2008 12:00:00 AM
asp.net datagrid control: How to set the Column's width at runtime.

I use the below statement but not working

Me.DataGridView1.Columns(0).Width = 50
Me.DataGridView1.Columns(1).Width = 300
Me.DataGridView1.Columns(2).Width = 100
Me.DataGridView1.Columns(3).Width = 200


Thanks

RE: Re : Very simple question, columns width rlm
1/23/2008 6:33:02 AM
I don't know where you are trying to set it but if you use this in the
Page_Load it works fine in C# provided the column isn't hidden.

DataGridView1.Columns[0].ItemStyle.Width = 200;
AddThis Social Bookmark Button