IF Condition in DataGridView

0

Hello.

How can I check the first number of a row in a grid?

Example:

 If Conversions.ToString(Me.DataGridView1.CurrentRow.Cells(0).Value)[0(primeiro número da row)] == (for igual a:) 5  Then 
 WebBrowser1.Document.GetElementById("ibMaster").InvokeMember("click")
If Conversions.ToString(Me.DataGridView1.CurrentRow.Cells(0).Value)[0(primeiro número da row)] == (for igual a:) 4  Then
 WebBrowser1.Document.GetElementById("ibFitness").InvokeMember("click")
    
asked by anonymous 10.08.2018 / 22:47

2 answers

0

I was almost there in the code that put it in your question!

If Convert.ToString(Me.DataGridView1.CurrentRow.Cells(0).Value)(0) = "5" Then
    WebBrowser1.Document.GetElementById("ibMaster").InvokeMember("click")
ElseIf Convert.ToString(Me.DataGridView1.CurrentRow.Cells(0).Value)(0) = "4" Then
    WebBrowser1.Document.GetElementById("ibFitness").InvokeMember("click")
End If
    
11.08.2018 / 17:42
0

You can therefore at the same time click the button:

For Each dg As DataGridViewRow In DGV_LANCAMENTO.Rows
    If dg.Cells(0).Value.ToString() = " valor em causa" Then
    End I
Next
    
11.08.2018 / 01:09