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. Image for the cookie policy date

Increase Number of Rows

Hi, I have a DataBoundGrid with 40 rows. When the user scrolls down the numbers of rows has to increase. For which i have overrided the onVScroll method of the grid. In which i have added a new row to the datasource and have called refreshRange(lastrow). A similar thing has been done by overriding the onKeyDown and incase of down arrow the number of rows increases. In case of the keydown event the refresh is smooth but incase of Vscroll the grid does not scroll to the new row. Is there any way i can improve the refresh incase of Vscroll without using the Refresh method (this method helps in scolling to the new row but is not as smooth as in when done with the down arrow which only calls the refreshrange method) Regards Vinay

3 Replies

AD Administrator Syncfusion Team April 7, 2005 01:26 PM UTC

Try adding the new rows in the TopRowChanging (or maybe TopRowChanged???) event. You can use the grid.ViewLayout.LastVisibleRow to get the last row displayed, and if it is close to your limit, then add your new rows to the datasource. The TopRowChanged event should be raised whether the user uses the keyboard or the scrollbar to scroll the grid.

VI Vinay April 7, 2005 03:27 PM UTC

Hi, Thanks for the help. I have been able to increase the rows using the TopRowChnaged Event, but the when using the scrollbar the rows are inserted but the scrollbar does not scroll to the last row. Regards Vinay

AD Administrator Syncfusion Team April 7, 2005 03:37 PM UTC

After inserting new rows, try calling grid.ResetVolatileData followed by grid.UpdateScrollBars. Or, you can try calling grid.Update which will do these calls plus some others as well.

Live Chat Icon For mobile
Up arrow icon