download gratis video tutorial vb 6 dan vb.net plus contoh aplikasi

cara membuat combobox dalam datagridview

 

Imports System.Data.OleDb

 

Public Class Penjualan

 

Sub Kolombaru()
DGV.Columns.Add("Kode", "Kode")
Call Koneksi()
DA = New OleDbDataAdapter("Select Nama_barang from tblbarang", CONN)
DS = New DataSet
DS.Clear()
DA.Fill(DS)

Dim cols As New DataGridViewComboBoxColumn
cols.DataSource = DS.Tables(0)
cols.DisplayMember = "Nama_barang"
DGV.Columns.Add(cols)
cols.HeaderText = "Nama Barang"
cols.Width = 200
DGV.Columns.Add("Harga", "Harga")
DGV.Columns.Add("Jumlah", "Jumlah")
DGV.Columns.Add("Total", "Total")
End Sub

 

Private Sub Penjualan_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.CenterToScreen()

Call Kolombaru()
End Sub

 

End Class