Home All Groups Group Topic Archive Search About

Column width in a Datagrid

Author
27 Jul 2006 9:41 AM
myname
Hello,

I'm using VB.Net 2003.

I can't figure out how to change the width of a column in a Datagrid.

I found some examples with Datagrid.Columns(i).Width
but I get the error "Columns is not a member of
System.Windows.Forms.Datagrid"...

How can I do that ?

Thanks !

Author
27 Jul 2006 11:22 AM
Ken Tucker [MVP]
Hi,

        You have to add a tablestyle to your datagrid to set the columns
width.  There are some examples here

http://www.vb-tips.com/dbpages.aspx?ID=407831b5-a9f5-4ac1-8268-14c8ba235fe7

Ken
---------------------
Show quoteHide quote
"myname" <nospam@ihatespam.com> wrote in message
news:44c887b0$1@news.sncf.fr...
> Hello,
>
> I'm using VB.Net 2003.
>
> I can't figure out how to change the width of a column in a Datagrid.
>
> I found some examples with Datagrid.Columns(i).Width
> but I get the error "Columns is not a member of
> System.Windows.Forms.Datagrid"...
>
> How can I do that ?
>
> Thanks !
>
>