Advertisement
7_2009-2012 Files/ File Controls/ Input/ Output #230350

DataGrid Columns

The purpose of the code is to show how to add columns to a VB.NET DataGrid control.

AI

Podsumowanie AI: 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.

Kod źródłowy
original-source
'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
Oryginalne komentarze (3)
Odzyskane z Wayback Machine