I may have asked a little prematurely. I've seem to at least create all the headings although it is a bit slow. Any ideas as to how to speed up the execution??? Below is the code I came up with.
Private Sub FormatGrid()
Dim Tbl As New DataTable
Dim I As Integer
Dim Col(31) As DataColumn
Dim HeadingName() As String = New String(31) {"Date", ...."Last Heading"}
' Define columns, specify the column data type, name is to identify the column,
' enable automatically increment the data, value to be displayed in the header
' of the column, make this column read only, Since it is autoincrement,
' add column to the datatable
For I = 0 To 31
Col(I) = New DataColumn
Col(I).DataType = System.Type.GetType("System.Int32")
Col(I).ColumnName = HeadingName(I)
Col(I).AutoIncrement = True
Col(I).Caption = HeadingName(I)
Col(I).ReadOnly = True
Tbl.Columns.Add(Col(I))
Next
' BIND THE DATATABLE TO THE DATAGRID
datagridOutput.DataSource = Tbl
End Sub
Jeff Armstrong
Sr. Systems Mgr
SBC Services, Inc.
|