Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2008 [RESOLVED] Datagridview combo column error

$
0
0
Hi Guys,

I have a datagridview control in my form. It has a few combo box type columns. What I want is to dynamically populate them ? No databases.

I am getting error "DataGridViewComboBoxCell value is not valid" when I populate the combo cell values manually.

For e.g. in DataGridView1_EditingControlShowing event, I wrote :

If DataGridView1.CurrentCell.ColumnIndex = 1 Then
Dim combo As ComboBox = CType(e.Control, ComboBox)
combo.Items.Add("Hello")
combo.Items.Add("Bye")
End If

Next I wanted to write that if value in col 1 is abcd then populate ... values in col 2. But I am getting the same error.

Can individual cells (combo type) have different values.

Please let me know what mistake I am making.

Thank you,

Cheers,
GR

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>