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 General Discussion » Setting up CExtGridWnd for variable row heights Collapse All
Subject Author Date
Ferdie Barbero Jun 7, 2006 - 11:52 AM

I am using CExtGridCellStringDM cell with __EGCS_EX_WRAP_TEXT ext style. How do I setup the grid so that it would automatically adjust each row to have a height that can accommodate the largest cell height in that row?

Thanks.

Technical Support Jun 8, 2006 - 4:52 AM

First of all, the grid window should support rows of variable height. So just remove the __EGBS_FIXED_SIZE_ROWS style from the grid window with the SiwModifyStyle() method. The grid window keeps the height of each row in its header cells. That means you should initialize one header column on the left with the OuterColumnCountLeftSet() and instantiate CExtGridCellHeader cell objects when initializing grid rows. You can set the minimum/maximum/current height for each row using the ExtentSet() method of header cells. To set the height of the row which is equal to the height of the content, just invoke the CExtGridWnd::BestFitRow() method. The same technique can be applied for columns.

Ferdz B Jun 9, 2006 - 12:43 AM

Beautiful. It worked!

I just needed the BestFitRow() function. I also saw BestFitColumn() and used it as well. Thanks a lot!