Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid column widths 1

Status
Not open for further replies.
Use the Columns collection to access each column in your datagrid.

Good luck!

Jordi Reineman

 
You could do something like this:

Datagrid is called MyDataGrid

Code:
Dim i As Integer
Dim iCountColumns As Integer
Dim oDGColumn As MSDataGridLib.Column

iCountColumns = MyDataGrid.Columns.Count - 1
   
For i = 0 To iCountColumns
   Set oDGColumn= MyDataGrid.Columns(i)
   oDGColumn.Caption = "Column " & i
   oDGColumn.Width = 1170
Next i

Set oDGColumn = Nothing


Good luck!

Jordi Reineman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top