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 » wrapped text in grid column header row Collapse All
Subject Author Date
Paul Cowan Jan 18, 2008 - 1:03 PM

How can I create a multi text row header cells for the data grid? I have column title that a longer then the column contents and I would like to make the header row double height and have a text wrap.

Technical Support Jan 19, 2008 - 12:17 PM

You should use an ordinary CExtGridCellHeader cell object in the header row and apply the __EGCS_EX_WRAP_TEXT extended cell style:

pCell->ModifyStyleEx( __EGCS_EX_WRAP_TEXT );
Then you can assign multiline text with \n line separator characters to this header grid cell and it will be displayed as multiline. Finally you should make the outer header row having an enough large height to make all the multiline strings completely visible. You can do this using the CExtGridWnd::OuterRowHeightSet() method, which sets the desired height of outer header row in pixels. The CExtGridWnd::BestFitRow() method allows you to measure the height of any row (inner data row or outer header row) and apply it.