We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Scrolling in a virtual grid

Thread ID:





63729 Jul 9,2007 10:05 AM UTC Jul 11,2007 11:24 PM UTC WinForms 3
Tags: GridControl
Lucia Diaconu
Asked On July 9, 2007 10:05 AM UTC


I created a virtual grid that first shows only the first page of 200 records (if exist) from a table.
The values are got asynchronously using a BackgroundWorker control.
In this state, I can scroll through the 200 records of the page.
After pressing a button, I actualized the number of records in the QueryRowCount event to the "real" number of records.
I expected to be able to scroll through all records, but somehow the scroll-bar remains fixed at 200, so it is impossible to see any other record.
Is it a bug or I missed something?
Thanks in advance,

haneefm [Syncfusion]
Replied On July 9, 2007 08:40 PM UTC

Hi Lucia,

Below is a forum thread that shows you "How to acheive the paging in a virtual grid?"

If you want to scroll the grid programmatically than set TopRowIndex property to new rowIndex. Below is a code snippet

this.grid.TopRowIndex = 400;

Best regards,

Lucia Diaconu
Replied On July 11, 2007 10:15 AM UTC

Thanks, Haneef!
I made a few steps forward and now the scrollbar reflects the real amount of data.

But I still have a problem: I want to make the scrolling operation cancellable.
For this I use a backgroundworker to provide the info in QueryCellInfo.
I move the scrollbar from position n1 to position n2.
Then I hit a Cancel button and I want to have the grid in the same state as before starting scrolling.
For this I cancel the data provider (no need to feed data) and cancel the backgroundworker.

So, while being in QueryCellInfo, the cancellation of the backgroundworker is caught and I try to reset the grid like this:
syncGrid.TopRowIndex = m_IndexFirstRowDisplayed;
(where m_IndexFirstRowDisplayed = n1)

Instead of having the grid as it was before the scroll, I obtain a blank grid...
I think I am missing something, again.
Thanks in advance,

haneefm [Syncfusion]
Replied On July 11, 2007 11:24 PM UTC

Hi Lucia,

You need to handle the TopRowIndexChanging event for cancelling the up and down movement of the cellview in a grid and handle LeftColChanging event for cancelling the left to right/right movement of the cellview in a grid. Below is a code snippet

private void grid_TopRowChanging(object sender, GridRowColIndexChangingEventArgs e)
e.Cancel =true;

Best regards,


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon