DataGrid Columns
The purpose of the code is to show how to add columns to a VB.NET DataGrid control.
AI
AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Source Code
'You can't have a data grid column without a DataTable ... I think :)
Private dbTable As New DataTable("DTBL1")
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim i = 0
'Add 4 columns to the table
For i = 1 To 4
dbTable.Columns.Add("Col" & i)
Next
'Set the datasource to our database table
DataGrid1.DataSource = dbTable
End Sub
Original Comments (3)
Recovered from Wayback Machine