Last active
December 17, 2015 10:49
-
-
Save pradesa/5597932 to your computer and use it in GitHub Desktop.
Find String in DataGridView
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'Prosesnya adalah membandingkan string dari Object Textbox dengan Kolom di DataGridView | |
| 'Kalo datanya ketemu, akan di set sebagai Current Row | |
| Public Shared Sub _FindRow(ByVal _DataGridView As DataGridView, ByVal _String As String) | |
| Dim data As String | |
| For x = 0 To _DataGridView.Rows.Count - 1 | |
| data = _DataGridView.Rows(x).Cells(1).Value | |
| Try | |
| If UCase(data.Substring(0, _STring.Length)) = UCase(_STring) Then | |
| _DataGridView.CurrentCell = _DataGridView.Rows(x).Cells(0) | |
| _DataGridView.CurrentRow.Selected = True | |
| Exit For | |
| End If | |
| Catch ex As Exception | |
| exit for | |
| End Try | |
| Next | |
| End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment