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 » CExtReportGridWnd row height does not change when text font is changed. Collapse All
Subject Author Date
Robert Hofstetter Jul 4, 2010 - 7:35 PM

I tried to use a large font in CExtReportGridWnd by overriding OnSiwGetDefaultFont() function. The grid fonts are increased but the row heights remain the same. so, the texts on the neighboring rows overlap each other and make them not readable. Is this a bug or I need to do something else, e.g. increase the row height accordingly? The grid’s header control has the same problem. The header text is larger than the header height.


Thanks for any suggestions

Robert Hofstetter Jul 5, 2010 - 6:10 PM

Thanks for the reply.


I actually use the same large font for every rows in the whole grid, not particular rows. Is there a simpler way so that the row height can grow bigger automatically according to the font height.


 

Technical Support Jul 6, 2010 - 6:59 AM

Any row in Prof-UIS grids can have a fixed or variable height (see the CExtGridBaseWnd::FixedSizeRowsSet() method, the __EGBS_FIXED_SIZE_ROWS style and the CExtGridBaseWnd::DefaultRowHeightSet() method). You can specify fixed size rows in report grid control and change heights of all the rows with invoking the CExtGridBaseWnd::FixedSizeRowsSet() and CExtGridBaseWnd::DefaultRowHeightSet() methods. But this is not recommended because the group rows look better with larger row height.

Technical Support Jul 5, 2010 - 12:13 PM

The report grid control always assumes you can use different fonts in any grid cells.
To increase data row height in your report grid control you should do the following:
1) Override the following virtual method in your CExtReportGridWnd class:

virtual bool OnTreeQueryPlainGridModeVeticalLayout() const
{
   return true;
}

2) Add at least one outer header column on the left:
   wndReportGrid.OuterColumnCountLeftSet( 1L, false );

This is needed for keeping information about a custom row height in each report grid’s data row.
3) If you don’t need outer header columns, then you can make it width equal to zero:
   wndReportGrid.OuterColumnWidthSet( true, 0L, 14 );

4) Initialize header cells in the outer header column at left and specify required row height:
 CExtGridCell * pCellHdr;
pCellHdr = GridCellGetOuterAtLeft( 0L, nRowNo, RUNTIME_CLASS( CExtGridCellHeaderFilter ) );
ASSERT_VALID( pCellHdr );
pCellHdr->ExtentSet( 40 );

The code above sets the row height to 40 pixels.

If you need to change the height of outer header row at top, then invoke the following code:
   wndReportGrid.OuterRowHeightSet( true, 0L, 40 );