techmanbd Posted October 16, 2003 Posted October 16, 2003 I am filling a datagrid with info I pulled in from from my database. Everything works like I want it to but one thing. The column size. Is there a way to basically autosize with what info is there. It brings back "Social Distortion" but all I see is "Socia" until I take the mouse to the column line and double click and the column snaps to the end of the text. i wou;ld like it to come up like that automatically. This is my Code Private Sub datagridit(ByVal strCommand As String, ByVal strTable As String) Dim myDataAD As New OdbcDataAdapter Dim myConnection As New OdbcConnection(strConnect) myConnection.Open() Dim myCommand As New OdbcCommand(strCommand, myConnection) Dim ds As New DataSet myDataAD = New OdbcDataAdapter(myCommand) myDataAD.Fill(ds, strTable) Me.DataGrid1.DataSource = ds.Tables(strTable) Me.DataGrid1.RowHeaderWidth = 0 myConnection.Close() myCommand.Dispose() myDataAD.Dispose() End Sub Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.