Using VB.NET
I want to add a data's in the Datagridviewcombobox column
Code.
cmd = New SqlCommand("SELECT Sched_Name from tb_Sched_Master", con)
ada = New SqlDataAdapter(cmd)
ada.Fill(ds1)
x.HeaderText = "Select Employee"
DataGrid4.Columns.Add(x)
x开发者_如何转开发.Items.Add(ds1.Tables(0))
But I cannot get the data's, what wrong in my code.
Need vb.net code Help
Try to set datasource property of your DataGridViewComboBoxColumn :
// Column that will be used to set the value of the items in your combobox :
yourColumn.ValueMember = "YourValueField"
// Column that will be displayed for items in your combobox :
yourColumn.DisplayMember = "YourTextField"
yourColumn.DataSource = ds1.Tables(0)
精彩评论