Private Sub selected()
Dim RowCount, i, Vtemp As Integer
Dim Vbefore As String
RowCount = dt.Rows.Count
For i = 0 To RowCount - 1 Step +1
Vbefore = dgv1.Rows(i).Cells(0).Value
If Vbefore = temp_showrecord Then
Vtemp = i
i = RowCount - 1
dgv1.Rows(Vtemp).Cells(0).Selected = True
Txt_Id.Text = dgv1.Rows(Vtemp).Cells(0).Value.ToString()
Cbo1.Text = dgv1.Rows(Vtemp).Cells(1).Value.ToString()
Cbo2.Text = dgv1.Rows(Vtemp).Cells(2).Value.ToString()
End If
Next