Want to find match value from first column of DataGridView and make the row highlighted.

  • Thread starter Thread starter AHM3DRAXA
  • Start date Start date
A

AHM3DRAXA

Guest
Hi,

I'm working on a phase where I have Tables and some Queries. I have populated ComboBox from Query Data and when i select the required data by dropping down the ComboBox, I want the DataGridView to be highlighted the row which the match value exist. For Example my first column in Table is "RegNumber" and my ComboBox Display Member is "RegNumber" from Query. So if my selected value in ComboBox is "SC13-ADPCS-F18-001" and it should make search in Table's first column of "RegNumber" if value matches, it should highlight the following row.


If Not String.IsNullOrWhiteSpace(RegNumberComboBox.Text) Then
Dim index As Integer = DocSubBindingSource.Find("RegNumber", RegNumberComboBox.Text)
If index > -1 Then
DocSubBindingSource.Position = index
End If
End If

I've tried coding like this, As described by Miss Karen. I've tested this method in another simple project but not working in this one.

PS: I'm using different Forms to work with this project.

Continue reading...
 
Back
Top