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 » Another bug in ItemHide Collapse All
Subject Author Date
Offer Har Jan 8, 2009 - 11:19 AM

Dear Support,


I am sending you another application to reproduce a bug related to ItemHide and ItemRemove.


Please re-evaluate these two functions, as there are sevral issues there, and our code rely on these two functrion.


Please let us know that you received the application that you were able to reproduce the bug.


Thanks,


Ron.


 

Technical Support Jan 8, 2009 - 2:38 PM

You can fix this by updating the following method:</p>

void CExtTreeGridCellNode::TreeNodeHiddenSet(
            CExtTreeGridDataProvider & _DP,
            bool bHide
            )
{
            ASSERT_VALID( this );
            ASSERT_VALID( (&_DP) );
            ASSERT_KINDOF( CExtTreeGridDataProvider, (&_DP) );
bool bHidden = TreeNodeHiddenGet();
            if( ( bHidden && bHide ) || ( (!bHidden) && (!bHide) ) )
                        return;
            if( bHide )
            {
                        if( TreeNodeIsDisplayed() )
                        {
                                    ULONG nOffset = TreeNodeCalcOffset( true, false );
                                    if( nOffset != ULONG(-1L) )
                                    {
                                                ASSERT( _DP.m_arrGridVis[ nOffset ] == this );
                                                INT nCountToRemove = _ContentWeight_Get( true );
                                                _DP.m_arrGridVis.RemoveAt( nOffset, nCountToRemove + 1 );
                                                CExtTreeGridCellNode * pNodeParent = TreeNodeGetParent();
                                                if( pNodeParent != NULL )
                                                {
                                                            ASSERT_VALID( pNodeParent );
                                                            pNodeParent->_ContentWeight_Decrement( nCountToRemove + 1, true );
                                                }
                                    }
                        }
                        ModifyStyleEx( __EGCS_EX_HIDDEN_TREE_NODE, 0 );
            } // if( bHide )
            else
            {
                        ModifyStyleEx( 0, __EGCS_EX_HIDDEN_TREE_NODE );
                        if( TreeNodeIsDisplayed() )
                        {
                                    _ContentWeight_Adjust();
                                    ULONG nOffset = TreeNodeCalcOffset( true, false );
                                    if( nOffset != ULONG(-1L) )
                                    {
                                                m_nContentWeightAll = ULONG( m_arrChildren.GetSize() );
                                                INT nCountToInsert = _ContentWeight_CalcVisible();
                                                //INT nCountToInsert = _ContentWeight_Get( true );
//                                              ULONG nOffset = TreeNodeCalcOffset( true );
//                                              ASSERT( nWeightVisible >= pNode->TreeNodeGetChildCount() );
                                                _DP.m_arrGridVis.InsertAt( nOffset, NULL, nCountToInsert + 1 );
                                                _DP.m_arrGridVis.SetAt( nOffset, this );
                                                nOffset ++;
                                                _Content_FillVisibleArray( _DP.m_arrGridVis, nOffset );
//                                              CExtTreeGridCellNode * pNodeParent = TreeNodeGetParent();
//                                              if( pNodeParent != NULL )
//                                              {
//                                                          ASSERT_VALID( pNodeParent );
//                                                          pNodeParent->_ContentWeight_Increment( nCountToInsert + 1, true );
//                                              }
                                    }
                        }
            } // else from if( bHide )
}

This is not the final fix. We are working on a similar issue related to more complicated nested row layouts in report grid. The fix above is related to a tree grid only.