Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8239109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:02:06+00:00 2026-06-07T20:02:06+00:00

For scrolling the datagrid, I use following code: dataGridView1.FirstDisplayedScrollingRowIndex = currentRowIndexInGridView; dataGridView1.Update(); That works

  • 0

For scrolling the datagrid, I use following code:

dataGridView1.FirstDisplayedScrollingRowIndex = currentRowIndexInGridView;
dataGridView1.Update();

That works fine for rows not at the bottom of the grid.
If I use it for bottom rows, the setter doesnt set it to the value I wanted, when I inspect it during debugging.
E.g. I am setting FirstDisplayedScrollingRowIndex= 103, but after the assignment FirstDisplayedScrollingRowIndex has the value 90 and hence the desired row is not visible.
From a certain point it stops scrolling and I cant see the last 5 rows.
If I am adding new rows and setting them to be displayed, it scrolls by one, but I dont see the last 5 rows again.

I think it has something to do with the fact, the some of my rows have different height and some internal estiment of DisplayedRowCount fails ???

Is there a way of detecting this situation and then forcing scrolling to the bottom of the datagrid?

EDIT:

The important part of the FirstDisplayedScrollingRowIndex setter looks like this in the Reflector:

 if (value > this.displayedBandsInfo.FirstDisplayedScrollingRow)
        {
            int rows = this.Rows.GetRowCount(DataGridViewElementStates.Visible, this.displayedBandsInfo.FirstDisplayedScrollingRow, value);
            this.ScrollRowsByCount(rows, (rows > 1) ? ScrollEventType.LargeIncrement : ScrollEventType.SmallIncrement);
        }
        else
        {
            this.ScrollRowIntoView(-1, value, true, false);
        }

There seems to be an error in computing the rows variable.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T20:02:08+00:00Added an answer on June 7, 2026 at 8:02 pm

    I had to force all the rows to have the same width, otherwise the

    FirstDisplayedScrollingRowIndex
    

    setter is buggy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a scrolling image script that I'd like to update the scroll speed
How can the code below be modified, such that I can use the arrow
I have implemented Infinite scrolling(i.e Load records when the scrollbar reaches the bottom of
I've got a DataGrid control that's within a Grid layout container, and I can't
While scrolling my web page a DIV which have a video is not going
How to implement scrolling animation? I'm ok with setting a simple AlphaAnimation that triggers
I've noticed that the default behaviour for a DataGrid's vertical scroll bar is to
I've got an SQL query that returns hundreds of rows, and I need to
I'm making a scrolling comment section, it works by having several elements echoed by
I have a scrolling div with a visible width that's half of the content.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.