我的问题是,如何在填写表格时填写特定列并默认使第一单位载入
Dim com As New DataGridViewComboBoxColumn
Dim dt As New DataTable
Dim da As New SqlDataAdapter
dt.Clear()
da = New SqlDataAdapter("select name_unit from unit where item_code =" & DataGridView1(0, DataGridView1.CurrentRow.Index).Value & " ", Con)
da.Fill(dt)
com.Name = "name_unit"
com.DataSource = dt
com.ValueMember = "name_unit"
DataGridView1.Columns.Add(com)