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 » CExtGridWnd Collapse All
Subject Author Date
Simon DESEE Aug 7, 2006 - 8:04 AM

Dear all,

How can I separate different rows of my grid (like category on property window, but on a grid) ?

Thanks for your help.

Technical Support Aug 7, 2006 - 9:45 AM

Thank you for the interesting question. There are two ways to separate row ranges (and/or columns) from each other. Both report grid and property grid windows use rows which have one cell per row. The property category rows and report grid rows cover the entire column range. Although the CExtGridWnd class does not support cell join feature, it is possible to override the CExtGridWnd::OnGbwAdjustRects() virtual method and change the cell rectangles on-the-fly. This approach can be used in scope of one grid row: you can make the first cell having a large width and covering all the columns and you can make all other cells having zero width.

You can reserve some space before and after each row and re-paint it if needed. For instance, the report grid control supports a data preview under each row. This feature is implemented using the built-in ability of the CExtGridWnd generic window to reserve space before/after each row/column. The report grid reserves space after each row and allows you to re-paint it. You can reserve space before some rows to have several row ranges in your grid window, separated from each other. To use this approach, the grid window should support rows with different heights, i.e. __EGBS_FIXED_SIZE_ROWS style should not be specified when invoking the SiwModifyStyle() method. Create a header column and initialize CExtGridCellHeader objects in it. These cells allow you to keep row heights. You can hide this header column by making it of zero size (using CExtGridWnd::OuterColumnWidthSet()). The header cells should be initialized when you insert data rows. You should use the CExtGridCell::ExtentSet() method for each header cell on the left to specify the row height. The CExtGridCell::ExtraSpaceSet() method allows you to specify extra space in pixels above or below the row for each header cell on the left. This will allow you to specify some extra space before each first row in each range of rows. As a result, you will see your row ranges visually separated from each other.