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

How can get the height of vertical scrolling bar of GridDataBoundGrid

Thread ID:





28757 May 10,2005 09:29 AM UTC May 11,2005 09:18 AM UTC WinForms 2
Tags: GridControl
Len Tran
Asked On May 10, 2005 09:29 AM UTC

Hi, I would like to have a height of vertical scrolling bar of GridDataBoundGrid to make the page number when the GridDataBoundGrid has lot of rows. The draft code is: pageNumber = heightOfGridDataBoundGrid/ heightOfVerticalScrollingBar When the height of GridDataBoundGrid is changed then the page number is also changed Thanks for your support! Len

Administrator [Syncfusion]
Replied On May 10, 2005 10:47 AM UTC

I am not sure this will allow you to do what you want. The height of all scrollable rows in the grid is: int heightAllRows = grid.Model.RowHeights.GetTotal(grid.Model.Rows.HeaderCount + 1, grid.Model.RowCount); The height of the scrollable client area is int heightOfScrollableClientArea = grid.ClientSize.Height - grid.Model.RowHeights.GetTotal(0, grid.Model.Rows.HeaderCount); But unless you are assuming all rows have equal heights, and that the grid is always sized so only an integral number of rows are vivible, I am not sure how your calcualtion will work. Some other calcualtions and properties you may want to consider using: grid.TopRowIndex - gets or sets the top scroallable row in the grid grid.ViewLayout.LastVisibleRowIndex - last visible row in the grid (may or may not be partially visible - check grid.ViewLayout.HasPartialVisibleRows to see)

Len Tran
Replied On May 11, 2005 09:18 AM UTC

Thank you! Another questions: 1) I would like to display the number of each page on label when croll is changed the position. How can I do that with the formula above?. Example: page 1 of 15, .... page 2 of 15 etc 2) What is the event of GridDataBoudGrid when I adjust the height of GridDataBoudGrid by mouse(at the bottom of GridDataBoundGrid) Thanks for your help!


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