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 » Grid cell border thickness and color Collapse All
Subject Author Date
Bart Kampers May 11, 2011 - 2:04 AM

Hello there,


Is it possible to alter the thickness or color of the border of a grid cell. I’d like to have extra heavy horizontal lines to separate partiitons within a grid.


Thanks in advance,



Technical Support May 11, 2011 - 7:24 AM

The grid lines are single pixel inner part of grid cells. I.e. each cell may have grid lines at bottom and right sides. The single pixel grid lines does not affect to the cell size measurement. They just painted under cell content close to the cell’s sides. The CExtGridWnd::OnSiwWalkCell() paints grid lines. The CExtGridBaseWnd::OnGbwQueryGridLinesColor() virtual method returns color of grid lines.
If you need wider grid lines, then you should reserve space for them and paint them manually. The default single pixel grid lines should be turned off in this case. You may notice many of grid control and grid cell methods have two RECT parameters: rcCell and rcCellExtra. The rcCell rectangle specifies cell location. All the inner built in cell parts (buttons, icon, text, check/radio, grid lines). The rcCellExtra rectangle specifies extra rectangle which includes rcCell and outer extra space. By default, these rectangles are equal. But you can reserve additional extra space before and/or after each row and/or column. The CExtGridCell::ExtraSpaceSet() method invoked for outer header cells allows you to reserve extra spaces for rows and columns. These extra spaces are needed for painting thick cell borders/grid lines. You can override the CExtGridCell::OnPaintBackground() or CExtGridWnd::OnGridHookCellPaintBackground() virtual methods to paint custom cell background, including borders.