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 » CExtGridWnd - autofit column to grid width Collapse All
Subject Author Date
Danil Asotsky Mar 31, 2010 - 12:43 PM


I have CExtGridWnd placed in CExtResizableDialog and I add anchors to CExtGridWnd control to fit all dialog window.My grid has a fixed number of columns.

I need to make total width of columns equal to width of grid control and automatically resize columns when dialog window size is changed.

E.g. user could not have horizontal scroll bar in grid and could not see any free area at the right side of the grid.

Can you propose some simple way to implement such behaviour of CExtGridWnd control?

Danil Asotsky Apr 1, 2010 - 9:34 AM

Thank you! It’s work fine.

Technical Support Apr 1, 2010 - 6:36 AM

First of all, your grid window should not use the horizontal scroll bar. This means you should specify the __ESIS_STH_NONE style (not the __ESIS_STH_ITEM or __ESIS_STH_PIXEL styles) using the SiwModifyStyle() API. Second, you should tell the grid control that it should perform automatic proportional resizing. This means you should specify the __EGBS_BSE_EX_PROPORTIONAL_COLUMN_WIDTHS style using the BseModifyStyleEx() API. The automatic proportional resizing for columns works only of the horizontal scrolling is disabled.