Datagredview row selection sortmode

My datagridview is: "DATAGRIDVIEW1" which has several Columns, but the columns in question are "LastName" and "VIN"

And I have several chunks of code that Gets me to letting customers enter FIND DATA and the code does take them to the correct row within the "DATAGRIDVIEW1"  but after that I would like to REORDER MY "ROWS ONLY" TO REFLECT THE DATA THEY HAVE INPUT???


If they select "LASTNAME" and  enter "SMITH"  I would like to reorder and show all the "SMITH'S" UNDER the row that they have selected.

Could anyone help me with the code
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MBHEY131Author Commented: and vs2012
It will have to be a custom sort

Example here
MBHEY131Author Commented:
ok - I've got the sort problem fixed - here is my next trouble - once I have gotten to the correct row and sorted correctly the Selected Row is not visible on the screen unless you use the sidebar and go and find it - not a huge issue but I would like the system to bring the selected row to the visible screen??? Could you help with that code??
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

MBHEY131Author Commented:
OK moving along now - the code "cform.CustomersBindingSource.MoveNext()" solved the datagridview1 to move to the selected row on the screen correctly, however somehow now we are getting an extra row selected for some reason:
Here's the code:
       cform.DataGridView1.AllowUserToAddRows = False
        For Each row As DataGridViewRow In cform.DataGridView1.Rows
            If cform.DataGridView1.Rows(intcount).Cells(CellToLookIn).Value.ToString = CustText Then
                cform.DataGridView1.Rows(intcount).Selected = True
                FindCust = True
                Exit Function
            End If
            intcount = intcount + 1
        cform.DataGridView1.AllowUserToAddRows = True

Open in new window

the only thing I added was the "cform.CustomersBindingSource.MoveNext()" line ??
MBHEY131Author Commented:
could you give me an example and tell me where to insert the example in the code?
At the end of the sort, just set the firstdisplayedscrollingrowindex to the index of the selected row.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.