We used v.2.83 for checking the problem described in your message. We checked the item removing code in the CExtTreeGridWnd
class and it works OK:
test_tree_grid_idea(with-hiding).zip
We used the FilteredGrids sample application to check hidden item deletion in the CExtReportGridWnd
class and it works OK. We modified the ChildView.cpp
file in this sample application for testing. We have added the following line at the top of this file:
CExtReportGridItem * g_SavedReportGridItem = NULL;
Then we modified the
CFilteredReportGridWnd::Init()
method
CTypedPtrArray < CPtrArray, CExtReportGridItem * > _arrItems;
_arrItems.InsertAt( 0, NULL, nRowCount );
ReportItemRegister( _arrItems, false, false );
g_SavedReportGridItem = _arrItems[ 0 ]; /// THIS LINE WAS ADDED
for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
And then we modified the following method:
void CFilteredReportGridWnd::OnClearAllFilters()
{
ASSERT_VALID( this );
// FilterStateClearAll();
if( g_SavedReportGridItem == NULL )
return;
::AfxMessageBox( _T("Click OK to hide first registered report grid row.") );
ItemHide( (HTREEITEM)g_SavedReportGridItem, true );
::AfxMessageBox( _T("Click OK to remove just hidden report grid row.") );
ItemRemove( (HTREEITEM)g_SavedReportGridItem );
g_SavedReportGridItem = NULL;
}
This modified version of the
FilteredGrids sample remembers the first registered report grid row at startup. So, if we run this sample application, select the tab page with report grid control and click on the
Clear All Filters button at the top of report grid, then the
CFilteredReportGridWnd::OnClearAllFilters()
method will be invoked and it will hide the saved at startup report row and then remove it. We didn’t come across any crashes. We tried to re-group the report grid and filter it before clicking the
Clear All Filters button, but failed to reproduce the crash. Here is the modified version of the
ChildView.cpp file from the
FilteredGrids sample application:
FilteredGrids_ChildView_CPP_test_hidden_remove.zipWe suspect the problem with hidden items removing in your application can be related to some older version of Prof-UIS or to some other source code specific to your project only. In any case, we would appreciate if you would help us re-produce this problem with v.2.83.