To set the headers, you can add code to QueryCellInfo an dset them there.
Private Sub GridQueryCellInfo(ByVal sender As Object, ByVal e As GridQueryCellInfoEventArgs)
If e.RowIndex = 0 And e.ColIndex > 0 Then
e.Style.Text = String.Format("col{0}", e.ColIndex)
ElseIf ((e.RowIndex > 0) _
AndAlso (e.ColIndex > 0)) Then
e.Style.CellValue = externalData((e.RowIndex - 1)).Items((e.ColIndex - 1))
If (e.ColIndex = 1) Then
e.Style.CellType = "TreeCell"
e.Style.Tag = externalData((e.RowIndex - 1)).IndentLevel
e.Style.ImageIndex = CType(externalData((e.RowIndex - 1)).ExpandState, Integer)
End If
e.Handled = True
End If
End Sub
The reason you cannot size the columns is that the columns widths are being set in the QueryColWidth event. You would have to remove that event to allow for teh default sizing to take place, or you would have to change the handler to size things in the event.