Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » How to get GridCells height and width Collapse All
Subject Author Date
Christian Herger Nov 13, 2009 - 8:08 AM

How can I retrieve the height and width of a cell / outer cell? GetExtend() is somewhat weird to me for it always returns the width.


Technical Support Nov 13, 2009 - 1:59 PM

About grid cells in data area (not header area):
The CExtScrollItemWnd::OnSiwQueryItemExtentH() method returns column width. Each column can have additional extra space reserved at left (before) and right(after).
The CExtScrollItemWnd::OnSiwQueryItemExtentV() method returns row height. Each row can have additional extra space reserved at top (before) and bottom(after).
So entire column width/row height consist of 3 parts: width/height, space before and space after. The extra spaces are typically equal to zero. But, the report grid uses extra space at the bottom of each row for implementing in-row previews.

About header cell areas:
The CExtGridBaseWnd::OuterColumnWidthGet() returns the outer header column widths at left/right.
The CExtGridBaseWnd::OuterRowHeightGet() returns the outer header column widths at top/bottom.

About any grid cells in any grid areas:
The CExtGridWnd::GridCellRectsGet() returns rectangle of any displayed grid cell and rectangles of built-in cell parts. It returns false flag if cell is outside the displayed cell range.
The set of overloaded CExtGridCell::MeasureCell() methods allow you to measure grid cell and get its minimal size when all the parts of grid cell are fully visible.