Hello,
I'm trying to use the datagrid control in .Net and so far I can't find the property to allow me to resize the columns. In VB6 I would simply use the .colwidth property...what is the .Net equivalent?
Thanks,
Sean
Printable View
Hello,
I'm trying to use the datagrid control in .Net and so far I can't find the property to allow me to resize the columns. In VB6 I would simply use the .colwidth property...what is the .Net equivalent?
Thanks,
Sean
DataGrid1.PreferredColumnWidth
be warned as I found out to my cost though, if you want to individually set the colum widths, you have to create a tablestyle and a column style, add the tablestyle to the datagrid and then use something like:
dg1 = DataGrid1.TableStyles(0).GridColumnStyles(1)
dg1.Width = 50
where dg1 is the datagridcolumnstyle and the number in brackets after Gridcolumnstyles is the column number (starting from 0 so 1 is the second colum and the width is in pixels