With my code, I want to be able to action a cellclick on an existing datagrid.
I can set the record (ID) and highlight the row as selected (as below), however need the next step to automatically 'click' on that record as it populates other parts of the form
Is it a case of calling existing sub? If so, what parameters do I pass to it? or?:
Thanks!
I can set the record (ID) and highlight the row as selected (as below), however need the next step to automatically 'click' on that record as it populates other parts of the form
Code:
For Each row As DataGridViewRow In FrmToursManage.DataGridView1.Rows
If Not row.IsNewRow Then
If CInt(row.Cells(0).Value) = CInt(ID) And CInt(row.Cells(0).Value) > 0 Then
FrmToursManage.DataGridView1.CurrentCell = FrmToursManage.DataGridView1.Rows(RowCount).Cells(1)
FrmToursManage.DataGridView1.Rows(RowCount).Selected = True
BoolClientFound = True
Exit For
End If
RowCount += 1
End If
Next
Code:
Private Sub DataGridView1_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellClick