Advertisement
6_2008-2009 Files/ File Controls/ Input/ Output #207832

DataGrid Columns

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

AI

สรุปโดย 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.

ซอร์สโค้ด
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
ความคิดเห็นดั้งเดิม (3)
กู้คืนจาก Wayback Machine