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 » CExtReportGridWnd And Row Height Collapse All
Subject Author Date
Bill Olson Nov 22, 2011 - 12:17 AM

I found this thread, but it didn’t help:;br />

I have a CExtReportGridWnd in a dialog that is displaying data from a file.  Some of the data can be multiple lines, some lines may be longer than the cell width and need to autowrap.  I set the cell characteristics with ModifyStyleEx adding the __EGCS_EX_WRAP_TEXT attribute.

I tried calling BestFitRow.  In the first case I’m working with, the row that needs to be multiline is the last row.  The syntax I’m using is:


BestRowFit returns FALSE.  I also tried setting the second argument to 0 also, but it got the same result.

With the mouse, I can resize the width of the cells by dragging the boundaries, but I can’t drag the cell height.  Is there a characteristic that needs to be set with ModifyStyle or ModifyStyleEx?


Bill Olson Nov 30, 2011 - 7:16 PM

That was it.  Adding OuterColumnWidthSet() fixed the problem.



Bill Olson Nov 29, 2011 - 3:17 AM

I use BestFitRows at the bottom of the function that fills the grid.  It’s the only place I call any BestFit functions




That got me the correct height on the cells.  When I used BestFitRow on a row by row basis, it didn’t work right.  I don’t recall what it did right now. 



Bill Olson Nov 25, 2011 - 8:21 PM

I think one version did have that set, but it isn’t there now.  Here are all the attributes I’m currently using:








Technical Support Nov 28, 2011 - 1:47 PM

We suspect you invoked the BestFitRow() API incorrectly. Here is the example:

CExtGreportGridWnd * wndRG = . . .
CExtReportGridItem * pRGI = . . .
LONG nRowNo = wndRG.ItemGetVisibleIndexOf( (HTREEITEM)pRGI );
    if( nRowNo >= 0L )
        { VERIFY( wndRG.BestFitRow( nRowNo ) ); }

Technical Support Nov 24, 2011 - 8:41 AM

We need to take a look at complete report grid initialization code. We suspect you applied the __EGBS_FIXED_SIZE_ROWS style.

Bill Olson Nov 23, 2011 - 3:20 AM

I’ve made some progress.  It appears I had some wrong attributes in the wrong functions.  I thought I had copied those from one of the samples, but I may have inadvertently messed something up when I was experimenting.  I also found the definitions of the ModifyStyle and ModifyStyleEx in the help file.  For some reason searching for them in the help document didn’t turn up the page with the explanations.  I found them looking for something else.

The only problem I have left is the left header column won’t resize or hide.  I could live with either.  Right now it’s a visual eye sore.  I either leave it blank and it ends up being a blank border, or I put text in there and the text gets cut off.


Technical Support Nov 28, 2011 - 1:43 PM

Did you invoke the OuterColumnWidthSet() API for the header column on the left?

Bill Olson Nov 22, 2011 - 9:26 PM

I scrapped the old approach and switched to a CExtGridWnd based on the test_grid_cells3 sample given to somebody having problems a while back.  I did have some problem getting the control to skin, but found the attribute to get that working.  BTW, is there any reference material available explaining what attributes do what for the grid controls and cell?  It appears there are quite a few attributes that can be turned on or off and I haven’t been able to find any comprehensive explanation of what does what.  The header file comments give some clues about how some of them work, but it’s less than complete.

I’ve been able to get most things working.  I found that you need a CExtGridCellHeader on the left to hold the cell height so you can adjust the height of a row.  I’ve gotten that working OK and it takes whatever string put in there and autowraps.

I saw a reference in the forum saying that if you don’t want a header row on the left, to make is 0 width, but no matter what I do, the left header boxes are a fixed width.  I initially tried using the left header column for my first column of data, which would be fine if I could make it wide enough.  Most of the text was cut off because the column was too narrow.  I moved the text to a regular column in column 1 and can resize it so the text is readable, but now I have a blank column on the left.

When I had text in the header column at left, I could resize the height of cells, but now that I have it blank, I seem to have lost the ability to resize height with the mouse, though I can change the width of the two regular columns.  I can’t change anything with the header column at left though.


Bill Olson Nov 22, 2011 - 12:24 AM

One more thing, if I mouse over the text in the cell with a very long line, the tool tip pop up shows the lines wrapped, but there is only one line displayed in the actual box.