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 » Multiline in Gridcontrol Collapse All
Subject Author Date
Anil Siddhpura Oct 23, 2009 - 2:41 AM


I have created a CextHeadeercell inside a gridcontrol. Now in this headercell can i set text in multiple line? I mean if my text size is larger than i want to set text in multiple lines automatically.

Is it possible with CextHeadercell or i have to use some other control inside grid?

Technical Support Oct 27, 2009 - 2:31 PM

Grid cells currently support only word based text wrapping. The character based wrapping is unsupported. We can assume this is the feature request.

Technical Support Oct 23, 2009 - 12:51 PM

There are two grid cell styles related to the multi line text:

1) The __EGCS_EX_WRAP_TEXT extended grid cell style makes single line text of a grid cell wrapped to several lines if there is no space to draw text in a single line.

2) The __EGCS_EX_MULTILINE_TEXT extended grid cell style makes the grid cell drawing its text as multi line. This style is new in Prof-UIS 2.87.

Anil Siddhpura Oct 24, 2009 - 1:02 AM


I have tried with __EGCS_EX_WRAP_TEXT with ModifyStyle and ModifyStyleEx functions, but still the text comes in single line only. I am using Prof-UIS 2.85.

My text is too long and the width of grid is limited. So i want to adjust the string in Multiline automatically when the text is too large. So the end user can see the whole text in the grid.

Is there anything remaining that i have to do?

Technical Support Oct 24, 2009 - 9:45 AM

You can take a look at the grid cells with the __EGCS_EX_WRAP_TEXT style in the Grid page of the ProfUIS_Controls sample application. Please note, the grid row height does not become automatically changed when some grid cells wrap their texts into several lines. You should change row heights manually. The CExtGridWnd::BestFitRow() method can re-measure all the grid cells in a row and set correct row height to make content of all the grid cells visible.

Anil Siddhpura Oct 25, 2009 - 7:24 AM


Yes i have see that sample, but in that you have set text in grid using "\r\n". So i think because of that it is showing in multiple lines.

My string is inside "CString" object and i can not use "\r\n" in that string. Because the length of string changed everytime and i want to set the string in multiple line at runtime. Also i m using CExtGridCellheader.

Technical Support Oct 25, 2009 - 12:44 PM

Please run the ProfUIS_Controls sample application, select the Grid page and scroll to the Text column. The grid cell in the second row from the top in this column uses the text wrapping feature. Initially it contains 3 text lines and you can make the Text column enough narrow to see how the text in each of 3 lines becomes wrapped. You may need to increase the height of the second grid row from the top to see the text wrapping completely. You can also edit the cell’s text. For example, you can enter the 1 2 3 4 5 6 7 8 9 0 single line text in it. You will see that the single line text is also wrapped by this grid cell.

Anil Siddhpura Oct 26, 2009 - 11:21 PM


Yes, i run that sample application and saw that it works for multiline. But it works only if there are space between words. My string does not contain any space. It’s the complete string and therefor it might not coming in multiline.

Is it possible to write in multiline even if there is no space in whole string?