DataGridView Scroll To Row?

Posted on 2007-07-21
Last Modified: 2008-09-22
I'm trying to make a "Quick Find" for a dataGridView.

I have a datagridVeiw filled with 40,000 rows and need to scroll the dataGridView to the number typed into a textbox.

The textBox event will fire the Quick Find code, but not sure how to scroll the loaded grid.

PrimaryKey,  Number,  Description
Question by:kvnsdr
    LVL 22

    Accepted Solution

    You can set the DataGridView.FirstDisplayedCell property to the index of the row. That should move it to the top of the grid.
    LVL 22

    Expert Comment

    Sorry - I meant to select Proposed solution for that.

    Expert Comment

    The actual answer to the question is to use DataGridView.FirstDisplayedScrollingRowIndex = (index of the selected row).

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
    Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now