Hi all.
Using VB6:
I have an application in which I am programmatically populating a datagrid.
When I first drop the datagrid on my form, it has 2 columns by default.
I can add further columns to them but I wanted to know if there was a tidy way of starting from column 1 to begin with, or do I just have to delete the first two columns and start again?

This is (pretty much) my column definition loop

For Each Col In RsDivisions.Fields

    Set c = DataGridDiv.Columns.Add(DataGridDiv.Columns.Count)
    With c
      .Visible = True
      .Width = 1000
      .Caption = Col.Name
      .Alignment = dbgRight
    End With

Next

I wanted to know if there was a tidy way of starting from column 1 to begin with

Remove one column when form load.

Private Sub Form_Load()
    DataGrid1.Columns.Remove 0
End Sub

Thanks guys.
I am getting the impression that the DataGrid component wasn't really designed to be used in this way.

This question has already been answered. Start a new discussion instead.