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

How can get the height of vertical scrolling bar of GridDataBoundGrid

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

2 Replies

AD Administrator Syncfusion Team 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)

LT Len Tran 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!

Live Chat Icon For mobile
Up arrow icon