I have been researching the DataGridView for few days but the progress is not that up to my expectation and hence i hope to get help from you guys. I have already inserted a ComboBoxColumn in my DataGridView, i want my combobox to retrieve the default data from the database for that particular row, the data can be "Pending, Approved, Disapproved".
I managed to do this by defining the .DataSource, .DataPropertyName but i can't insert "Pending, Approved, Disapproved" as an item collection for combobox.
If i define the item of combox using Items.Add then i can't make use of the .DataPropertyName anymore and the combobox default value will be null. It seems no matter how hard i try, i can only fulfill one of my design requirements. Anyone can help on it? Thank you.
I managed to do this by defining the .DataSource, .DataPropertyName but i can't insert "Pending, Approved, Disapproved" as an item collection for combobox.
If i define the item of combox using Items.Add then i can't make use of the .DataPropertyName anymore and the combobox default value will be null. It seems no matter how hard i try, i can only fulfill one of my design requirements. Anyone can help on it? Thank you.
VB.NET:
Dim DGVColumn As New DataGridViewComboBoxColumn
With DGVColumn
.HeaderText = "Plan Status"
.DataSource = DataSet2.Tables("Plan_Status")
.DataPropertyName = "p_status"
.ValueMember = "p_status"
.DisplayMember = "combo1"
.Width = "200"
End With
DataGridView1.Columns.Add(DGVColumn)
Last edited: