|
-
Mar 15th, 2002, 08:25 AM
#1
Thread Starter
New Member
Change column width of .Net DataGrid
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
-
Mar 15th, 2002, 08:52 AM
#2
Thread Starter
New Member
Found it...
DataGrid1.PreferredColumnWidth
-
Mar 18th, 2002, 02:17 PM
#3
Hyperactive Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|