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 » About combo in the CExtPropertyGrid. Collapse All
Subject Author Date
tera t Mar 13, 2008 - 8:45 PM

Hello.

About combo in the property grid.
Even if I appoint SetCurSel(0) in Combo.
After property construction, the zeroth string is not displayed.

http://www.yukai.jp/~ifreeta/20080314/image01.jpg

"String1" wants to be displayed.

CExtPropertyItem * pValueHouhou =    new CExtPropertyValue( _T("??") );
CExtGridCellComboBox * pCellHouhou = STATIC_DOWNCAST( CExtGridCellComboBox,
    pValueHouhou->ValueDefaultGetByRTC( RUNTIME_CLASS(CExtGridCellComboBox) ) );
pCellHouhou->InsertString( _T("String1") );
pCellHouhou->InsertString( _T("String2") );
pCellHouhou->SetCurSel( 0, true );
pCellHouhou->SetEnumMode(TRUE);
pValueHouhou->ValueActiveFromDefault();
VERIFY( pInputCategory->ItemInsert( pValueHouhou ) );

tera t Mar 18, 2008 - 6:29 PM

Hello.

sorry.
I compiled a program in Prof-UIS2.82.
The program worked definitely.

Technical Support Mar 18, 2008 - 1:41 PM

Could you compare the following method from the latest library version with your one? As you can see the current selection is transferred correctly between two cell objects.
If you still have the problem it would be better if you repeat it in one of our samples and send the modified sources to us. You can also create a simple test project from the scratch.

void CExtGridCellComboBox::Assign( const CExtGridCell & other )
{
            ASSERT_VALID( this );
            CExtGridCellString::Assign( other );
CExtGridCellComboBox * pCell =
                        DYNAMIC_DOWNCAST(
                                   CExtGridCellComboBox,
                                   ( const_cast < CExtGridCell * > ( &other ) )
                                   );
            ResetContent();
            if( pCell != NULL )
            {
                        // copy cell items
                        ITEM_INFO * pItemCurSel = NULL;
                        LONG nItem = 0;
                        for( nItem = 0; nItem < pCell->m_arrItems.GetSize(); nItem++ )
                        {
                                   ITEM_INFO * pOtherItem = pCell->m_arrItems[ nItem ];
                                   ITEM_INFO * pNewItem = new ITEM_INFO( *pOtherItem );
                                   m_arrItems.Add( pNewItem );
                                   if( pCell->m_pCurSel == pOtherItem )
                                               pItemCurSel = pNewItem;
                        }
                        m_bEnumMode = pCell->m_bEnumMode;
                        SetImageList( pCell->m_pImageList );
                        if( pItemCurSel != NULL )
                        {
                                    nItem = _GetIndexOf( pItemCurSel );
                                   SetCurSel( nItem );
                        }
            } // if( pCell != NULL )
}


tera t Mar 18, 2008 - 3:23 AM

Hello.

Combo-CurSel is not done Clone of definitely.
It is a bug?

Technical Support Mar 17, 2008 - 6:18 AM

You should first initialize the default value’s grid cell and only then invoke pValueHouhou->ValueActiveFromDefault();.