Seek - Softseek a record

SPRASAD

Member
Joined
Mar 11, 2003
Messages
5
I am new to VB.Net. I have been programming in VB6.

I am trying a simple test project to learn VB.NET before starting my actual
apps.

I have a DataGrid that displays all the records from my database. Its no
problem getting all the records to display in the grid.
The problem is when I enter text in in a text control I like to highlight
the record that matches or is a close match to text I entered. I cant seem
to be able to this.

Please any help will be greatly appreciated.
:confused:
 
I made this and it worked fine:
Code:
    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        Dim i As Integer
        For i = 0 To DataGrid1.VisibleRowCount - 1
            If DataGrid1.Item(i, 1).ToString.ToLower _  
            Like TextBox1.Text.ToLower & "*" _
            And Not TextBox1.Text = "" Then
                DataGrid1.Select(i)
            Else
                DataGrid1.UnSelect(i)
            End If
        Next
    End Sub

Hope it will help you.
 
I noticed that the DataGrid1.VisibleRowCount wont return the total row count, just the ones that appear on the screen. And I didnt find a way to count it. But you can count the records of your dataset instead.
 
Back
Top