
How to auto resize columns in DataGrid?
Paul
Try
DataGrid.Columns(Y).Width = Me.TextWidth(String(objRS.Fields(Y).DefinedSize,
"WWWWW"))
Instead of W you may use any other letter to suit your needs
Sukesh
Quote:
> Hi,
> The MSFlexGrid control has an AutoResize column property but the DataGrid
> control doesnt so I need to know how to resize each column to the length
of
> the longest cell in each column. I think I need know the text length of
the
> longest cell in a row in a particular column in order to get the length
but
> I'm not sure how to do this, any ideas?
> Thanks