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 » Resetting sort order in CExtReportGridWnd Collapse All
Subject Author Date
Christophe Guibert Jul 2, 2006 - 8:32 AM

Hello,

Your ReportGrid sample shows how to reset the current sort order with a ReportSortOrderSet( _rgsoNew, true ) instruction.

What about adding this feature to the default column header pop up menu, just after the "sort ascending" and "sort descending" entries ?
Since this is persistent, it would be logical to be able to cancel the effects of these entries, directly from the menu.

Best Regards,

Christophe Guibert

Technical Support Jul 3, 2006 - 10:05 AM

A simple scenario of using the report grid may be as follows:

1) Some dialog or frame window is created. It initializes all its child windows, including the report grid.

2) The data and sort order of the report grid window may be changed during the dialog/frame life time.

3) The dialog/frame is destroyed with saving states of its child components including the report grid.

In this case, the feature sounds reasonable. But if the report grid is reused several times and with changing its data and column structure completely, the state re-setting can make the report grid more complicated.

In any case, you can override the CExtReportGridWnd::OnReportGridColumnCtxMenuConstruct() virtual method and add the needed menu items into the popup menu which will be displayed over the header cell.

Christophe Guibert Jul 3, 2006 - 3:46 AM

Hello,

I would add that when all columns have been hidden, it would be useful to be able to show the popup menu in the ReportGrid header.
In the current ReportGrid, user can reach dead ends from where he can’t restore a default behavior (especially with state persistence).
Best Regards,

C. Guibert

Technical Support Jul 3, 2006 - 10:10 AM

There are three ways to do this:

1) As you suggested.

2) As it is done in the ReportGrid sample: add menu/toolbar commands for managing the report grid.

3) As it is done in the "super grid" window in MS Outlook: disable removing the last active column.

All the ways are acceptable. You can simply handle the WM_RBUTTONDOWN message and track the context menu anywhere if the number of active columns is zero. You can override the CExtReportGridWnd::ReportColumnActivate() virtual method to prevent removing the last active column. The CExtReportGridWnd::ReportColumnGetCount() method allows you to get the number of active and/or inactive columns.

Christophe Guibert Jul 4, 2006 - 2:45 PM

Thank you very much for your support. I chose the third method.
Best Regards,

C. Guibert