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 » CExtGridWnd selection disappearing Collapse All
Subject Author Date
D. Cameron DeHeer Sep 19, 2007 - 8:08 AM

hello,
i am using a CExtGridWnd in association with a CExtPropertyGridWnd in my application, where the grid contains a list of items with some properties, and the full set of properties for the selected item in the grid is modifiable from the property grid. i have overridden CExtGridWnd::OnGbwSelectionChanged to update the currently selected item in the associated property grid. when i select a new item in the grid i get an OnGbwSelectionChanged to the proper item, which is fine. if i then select a property in the property grid to change, i do not get an OnGbwSelectionChanged, which is also fine (the grid selection has not changed). however, if i then modify that property (via an up/down button for example), or select a different property in the property grid, i get an OnGbwSelectionChanged in the grid that essentially sets the selection to nothing (which my code then responds to by setting the property grid’s item to null). i have created the grid with:

SiwModifyStyle(
    __ESIS_STH_PIXEL|__ESIS_STV_ITEM
    |__EGBS_SFM_CELLS_V|__EGBS_SF_SELECT_OUTER_COLUMNS|__EGBS_SF_SELECT_OUTER_ROWS
    |__EGBS_RESIZING_CELLS_OUTER|__EGBS_NO_HIDE_SELECTION
    |__EGBS_GRIDLINES|__EGBS_LBEXT_SELECTION|__EGBS_SUBTRACT_SEL_AREAS,
    0,
    false);
SiwModifyStyleEx(
    __EGBS_EX_CELL_TOOLTIPS_OUTER|__EGBS_EX_CELL_EXPANDING_INNER
    |__EGBS_EX_CORNER_AREAS_3D|__EGBS_EX_CORNER_AREAS_CURVE,
    0,
    false);
BseModifyStyle(
    __EGWS_BSE_WALK,
    0,
    false);

any ideas why my grid selection is going away? thanks in advance for any help you can provide...
cameron

Technical Support Sep 19, 2007 - 1:14 PM

We need more details about how you manage selections in the CExtGridWnd control. Please let us know If you change selection using CExtGridBaseWnd::Selection***() APIs when handling property value changing in the property grid?

Generally, the OnGbwSelectionChanged() virtual method notifies you about changing a selection region rather than about changing grid cell values.

D. Cameron DeHeer Sep 19, 2007 - 1:57 PM

hello,
thanks for the quick response, but i’m afraid i wasted your time. when the property grid values changed, i was repopulating the entire grid rather than just the affected row in the overloaded CExtPropertyGrid::OnPgcInputComplete. this (of course) caused the selection in the grid to be lost. sorry to have bothered you with this, and thanks again for the help...
cameron

Technical Support Sep 20, 2007 - 5:42 AM

You are welcome and you can also send your project to support@prof-uis.com if you encounter any difficulties.