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 General Discussion » About CExtGridCellComboBox Collapse All
Subject Author Date
Paolo Giustinoni Jul 10, 2006 - 5:53 AM

How can I handle to user’s selection of an item in a CExtGridCellComboBox cell?
In particular, I have to let the user to specify no selection in the combo box; so, when the user select this particular element, the cell perform a SetCurSel(-1), to clear the current selected element.

Thanks, Paolo

Technical Support Jul 10, 2006 - 9:40 AM

To catch the selection changed event, create a CExtGridCellComboBox-derived class and override the CExtGridCell::OnPopupListBoxSelEndOK() virtual method, which should return a value from the parent method and perform your custom actions. The OnPopupListBoxSelEndOK() virtual method is called to handle the final item selection changed event of the list box control in the pop-up menu tracked by the built-in button.

// *.h file:

virtual bool OnPopupListBoxSelEndOK(
CExtPopupInplaceListBox & wndListBox,
CExtGridCell::TrackCellStateInfo_t & _tcsi
);


// *.cpp file:

bool CYourCellCombo::OnPopupListBoxSelEndOK(
CExtPopupInplaceListBox & wndListBox,
CExtGridCell::TrackCellStateInfo_t & _tcsi
)
{
ASSERT_VALID( this );
ASSERT( (&_tcsi.m_cell) == this );
ASSERT_VALID( (&wndListBox) );
ASSERT_VALID( (&_tcsi.m_wndGrid) );

CExtGridCellDropListComboBox::OnPopupListBoxSelEndOK(
wndListBox,
_tcsi
);

// place your code

return false;
} 
You can also override the CExtGridWnd::OnGridCellInputComplete() virtual method that is called to handle the event when the cell gets changed. This method is called for all the cells types.