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 » Grid Cell combo question Collapse All
Subject Author Date
Offer Har Apr 8, 2008 - 9:25 AM

Dear Support,


I have a combo grid cell with a list of items that are changing all the time. I would like to update the drop list only when the user presses the drop list button, so I won’t need to keep on tracking the changes (complexity and performance issues).


Is it possible to get to change the list’s items before the list is being displayed?


Thanks,


Ron.

Technical Support Apr 8, 2008 - 12:53 PM

You can use a combo box grid cell or even a simple string cell based class. You should implement the CExtGridCell::OnPopupListBoxInitContent() virtual method.

Offer Har Apr 8, 2008 - 2:36 PM

Dear Support,


I think that a better solution (which I use now) is to derive from CExtGridCellComboBox and implement OnPopupListBoxMeasureTrackSize like this:



CSize CGridCellMyInstantCombo::OnPopupListBoxMeasureTrackSize(
    CExtGridCell::TrackCellStateInfo_t & _tcsi,
    CExtPopupListBoxMenuWnd * pPopup)
{
    // Remove all items from the combo:
    ResetContent();
    
    // Add the itmes needed to be displayed in the drop-list
    AddString("Item 1", 1);
    AddString("Item 2", 2);

    // Call the base to resize, and later will also show all items added right now:
    return CExtGridCellComboBox::OnPopupListBoxMeasureTrackSize(_tcsi, pPopup);
}


The reason is that by doing this, the combo-box cell will do the resizing of the drop list, and the outcome looks exactly like a normal combo-box cell, including all the even firing etc.


FYI.

Technical Support Apr 10, 2008 - 10:47 AM

Your code is OK because both OnPopupListBoxInitContent() and OnPopupListBoxMeasureTrackSize() virtual methods are invoked only one time during initialization of the popup list box menu window displayed by grid cell’s built-in drop-down button.

Offer Har Apr 10, 2008 - 11:06 AM

It works very nice...

Offer Har Apr 8, 2008 - 1:06 PM

Is this function called each time the drop list button is pressed?

Technical Support Apr 9, 2008 - 7:48 AM

Yes, it is.