Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

How to check which item is selected in a datagridview combobox?

$
0
0
I try to check which data is selected in a datagridview combobox

Dim status As Double
    For x As Integer = 0 To ATCGRID.Rows.Count - 1
        If ATCGRID.Rows(x).Cells(2).Value = "Full" Then
            status = 1
        ElseIf ATCGRID.Rows(x).Cells(2).Value = "Empty" Then
            status = 0
        ElseIf ATCGRID.Rows(x).Cells(2).Value = "Half" Then
            status = 0.5
        End If
        MessageBox.Show(status)
    Next x

But it shows error

Conversion from string "Full" to type "Double" is not valid.

How i check this?? Please check this code and correct me....

Viewing all articles
Browse latest Browse all 51036

Trending Articles



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