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.
Unfortunately, activation email could not send to your email. Please try again.

How can get the height of vertical scrolling bar of GridDataBoundGrid

Thread ID:





28757 May 10,2005 05:29 AM May 11,2005 05:18 AM Windows Forms 2
Tags: GridControl
Len Tran
Asked On May 10, 2005 05:29 AM

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 06:47 AM

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 05:18 AM

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.

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.