Professional UI Solutions
Site Map   /  Register
 
 

Forum

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 Tech Support » Anchors and grid columns Collapse All
Subject Author Date
Leland Dykes Nov 9, 2006 - 12:32 PM

Given a CExtGridWnd thats anchored for dynamic re-sizing, is there a way to get column widths to resize automatically, other than to anchor the hWnds of each and every cell?

Technical Support Nov 10, 2006 - 10:13 AM

Any grid cell is an object of the CExtGridCell class or derived from it and not based on HWND.

We are not sure completely what you mean exactly but if you want to have a grid with columns that change accordingly to the grid’s width (as in the ReportGrid sample), you can achieve this in the following way:

1) Apply the __EGBS_BSE_EX_PROPORTIONAL_COLUMN_WIDTHS style to the grid window (use the CExtGridWnd::BseModifyStyleEx() method for that).

2) Specify the weight of each column (i.e., how the column’s width should change) using the CExtGridCell::ExtentPercentSet() method of the column header cell. The weight values should be in the range of 0.0 to 1.0.

3) Keep in mind that you can also set the initial, minimum, and maximum width for each column using the CExtGridCell::ExtentSet() of the header cell. The column will be not resizable at all, if these width values are equal to each other.

Offer Har Nov 23, 2006 - 12:20 PM

Dear Support,

Does this apply to Property Grid as well?
If so, then how?

Thanks.

Technical Support Nov 27, 2006 - 1:28 PM

This is not applicable to the tree grid windows inside the property grid control because they have only two columns and perform the synchronization of column width with each other.

Offer Har Nov 27, 2006 - 2:26 PM

This brings me back to my problem of controlling the property grid’s column myself - still waiting for a sample.