View Single Post
  #2 (permalink)  
Old November 12th, 2004, 04:43 PM
ja8261 ja8261 is offline
Authorized User
 
Join Date: Aug 2004
Location: OKC, OK, USA.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.