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 » Grid Control: Multiple Lines for Column Header and turning off editing Collapse All
Subject Author Date
Douglas Hoppes Oct 1, 2007 - 1:05 PM

Hi all,

Two simple questions that I can’t seem to find the documentation on.

1) How do I have multiple lines in the title column of a grid control. I would like to have my title column read as "Contour Section" where the word Section is below the first line. In many other systems, you typically use the text "Contour~r~nSection", or some variation.

2) I read the FAQ about making column not editable, but it doesn’t seem to work. I can still click on the grid and type in a value.

Any help is greatly appreciated.

Doug

Suhai Gyorgy Oct 2, 2007 - 2:38 AM

1) First you have to increase the height of the header row, you can do this with the following ( for the single top header row ):
m_wndGrid.OuterRowHeightSet( true, 0L, 28 );
Then you have to make the header cell wrap its text:
pCellHeader->ModifyStyleEx(__EGCS_EX_WRAP_TEXT);
Last step, you have to set its text like this:
pCellHeader->TextSet( _T("Contour\r\nSection") );

2) You can’t make a whole column read-only, you have to make every single cell of it read-only. You can achieve this either with the __EGCS_NO_INPLACE_CONTROL style or with the __EGCS_READ_ONLY style. If you set __EGCS_READ_ONLY style, users will be able to activate the inplace editor, but it will be read-only ( this can be useful if you want to let the user copy text from the inplace control ).
for ( each cell in your column ) {
    pCell->ModifyStyle(__EGCS_READ_ONLY); // or pCell->ModifyStyle(__EGCS_NO_INPLACE_CONTROL);
}