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::ReportSortOrderUpdate Collapse All
Subject Author Date
Suhai Gyorgy Jul 24, 2007 - 9:10 AM

Dear Support,

In your ReportGrid sample, the grid is filled during initialization, so ReportGridStateLoad is called after the ReportItemRegister calls. If in the registry any of the columns are set to an alignment different from the default, ReportGridStateLoad sets the cells of that column accordingly.

In our application, the grid is filled from a file, during application run, so we need to call ReportSortOrderUpdate after the grid is filled with lines. I read in Help file, that ReportSortOrderUpdate updates the "content according to the current sorting and grouping rules". But column Alignment is not updated, so if user changes the default alignment of any of the columns, filling the grid in runtime causes that only the column header cell is with the appropiate alignment, but not the inner cells. Could ReportSortOrderUpdate set proper alignment as well?

Thank you!

Technical Support Jul 25, 2007 - 10:05 AM

The following code adjusts alignment for a column:

CExtReportGridWnd * pRGW = . . .
CExtReportGridColumn * pRGC = . . .
DWORD dwAlignment = pRGC->GetStyle()&__EGCS_TA_HORZ_MASK;
pRGW->ReportColumnAdjustTextAlignmentH( pRGC, dwAlignment );
The below code does the same for all columns:
CExtReportGridWnd * pRGW = . . .
POSITION pos = pRGW->ReportColumnGetStartPosition();
      for( ; pos != NULL; )
      {
            CExtReportGridColumn * pRGC = pRGW->ReportColumnGetNext( pos );
            DWORD dwAlignment = pRGC->GetStyle()&__EGCS_TA_HORZ_MASK;
            pRGW->ReportColumnAdjustTextAlignmentH( pRGC, dwAlignment );
      }
We could add some method which does the same for one report item (row) only. So you believe it would be helpful, please let us know.

Suhai Gyorgy Jul 26, 2007 - 4:20 AM

Thank you, I will use this given code then, and I think I can handle doing it for one row only.

Since both ReportSortOrderUpdate and this alignment-updating code need to be called whenever one or more lines are added to/removed from the grid in runtime, I was just trying to suggest that this updating code could be integrated into ReportSortOrderUpdate. Maybe an additional parameter could indicate whether this updating needs to be done or not. But I understand that downward compatibility issues make changing a method signature this way pretty difficult.