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 » ReportGrid + __EGCS_HDR_ROW_COLUMN_NUMBER Collapse All
Subject Author Date
Osmin Lazo Jun 21, 2008 - 3:35 PM

Hi,


I am using the method GridCellGetOuterAtLeft and ModifyStyle to set the style __EGCS_HDR_ROW_COLUMN_NUMBER in the outer cell. This works well when displaying rows even with the preview area being shown, I mean the row numbers show up correctly. However, if the user ’groups by’ any of the columns then the row numbers don’t seem to work correctly. It seems that even though the row number is not included in the outer cell belonging to the group header (the row that allows the user to collapse or expand it) the row number count is still being incremented such that; the next actual row will contain a value higher than it should be.

So the question is, is there anything else I need to do in order to have the row count to skip the Group row?  


Thanks in advanced... 


Technical Support Jun 22, 2008 - 1:38 PM

We do not see any reason to walk through tree rows and count something. All the painting virtual methods in grid cell and grid control classes have plain zero-based row/column numbers in parameters.

Technical Support Jun 22, 2008 - 1:37 PM

Did you implement the CExtReportGridWnd::OnReportGridItemInitializeOuterCells() virtual method? The CExtReportGridWnd control re-initializes the group rows when the grouping rules has changed and implementing this virtual method allows you to initialize outer header cells in group rows. The source code of the original CExtReportGridWnd::OnReportGridItemInitializeOuterCells() virtual method does nothing but it contains some code that is commented out and that is very similar to what you need:

void CExtReportGridWnd::OnReportGridItemInitializeOuterCells(
      CExtReportGridItem * pRGI
      )
{
      ASSERT_VALID( this );
      ASSERT_VALID( pRGI );
      pRGI;
//LONG nIndex, nCount = OuterColumnCountLeftGet();
//    for( nIndex = 0; nIndex < nCount; nIndex ++ )
//    {
//          CExtGridCell * pCell = ReportItemGetOuterColumnCell( nIndex, true, pRGI );
//          ASSERT_VALID( pCell );
//          if( nIndex == ( nCount - 1 ) )
//                pCell->ModifyStyle( __EGCS_HDR_FOCUS_ARROW_RESERVE_SPACE|__EGCS_HDR_FOCUS_ARROW_DISPLAY );
//    }
//    nCount = OuterColumnCountRightGet();
//    for( nIndex = 0; nIndex < nCount; nIndex ++ )
//    {
//          CExtGridCell * pCell = ReportItemGetOuterColumnCell( nIndex, false, pRGI );
//          ASSERT_VALID( pCell );
//          if( nIndex == 0 )
//                pCell->ModifyStyle( __EGCS_HDR_FOCUS_ARROW_RESERVE_SPACE|__EGCS_HDR_FOCUS_ARROW_DISPLAY );
//    }
}



Offer Har Jun 21, 2008 - 4:41 PM

I had the same problem in tree grid - what I did was implement the numbering myself, and not use the __EGCS_HDR_ROW_COLUMN_NUMBER feature. The algorithm is not too complicated, just run over all rows when node collapsed/expends, and redraw the numbers.

Osmin Lazo Jun 22, 2008 - 9:07 PM

The problem seems to be that the method OnFormatHeaderNumberString checks for the type of row before incrementing the count but there are only three types of rows, 0 - inner row, -1 - outer row at top, 1 - outer row at bottom. Since there is no row type constant for group rows the row is treated as a regular row and the count is ++


I guess I’ll follow Offer’s advice and try to implement this functionality somehow.


Thanks everyone.