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 » Updating property grid Collapse All
Subject Author Date
Malcolm D Sep 9, 2007 - 6:02 PM

I have been trying to work out how to avoid calling PropertyStoreSyncronizeAll, and also how to miminse the effect it has when being called.

Previous dialog has occured at the following link, though I didn’t get all my questions answered:
http://www.prof-uis.com/Forum_View.aspx?CID=29&M=56525&s=synchronise

The main question I would like answered is as following. When PropertyStoreSyncronizeAll gets called, the tree window scrolls to the top, the currently selected item is unselected, including any inplace controls hiding. Is there any way to get the information and restore it (as much as possible) after the call to PropertyStoreSyncronizeAll?

Thanks

Malcolm D Sep 12, 2007 - 4:53 PM

I am not sure how this functions as a features request. I guess, yes, that if I could have something that performed perfectly then it would be a features request. Well until I get that thing, I am hoping for something else, as I mentioned in the first post:

"When PropertyStoreSyncronizeAll gets called, the tree window scrolls to the top, the currently selected item is unselected, including any inplace controls hiding. Is there any way to get the information and restore it (as much as possible) after the call to PropertyStoreSyncronizeAll?"
i.e. get and restore the current scroll position, get and resotre the currently selected item etc.

In relation to the invisible rows - I have been using a mechanism that is already available in 2.7 (or possibly earlier). As I said in the previous thread of posts, the very use of this current mechanism guarantees you will have the problem. I.E. to hide or show the items a call to PropertyStoreSyncronizeAll must be made, hence we get the problem.

Technical Support Sep 13, 2007 - 5:58 AM

You can restore the scrolling position using the following code:

CExtPropertyGridCtrl * pPGC = . . .
CExtPropertyGridWnd * pPGW = pPGC->GetActiveGrid();
      ASSERT_VALID( pPGW );
      pPGW->SetRedraw( FALSE );
      CPoint ptScroll = pPGW->OnSwGetScrollPos ();

      // change the property store here . . .

      pPGC->PropertyStoreSynchronize();
      pPGW->OnSwSetScrollPos( ptScroll );
      pPGW->SetRedraw( TRUE );
But this method is still based on the existing CExtPropertyGridCtrl::PropertyStoreSynchronize() method which re-initializes the tree grid windows inside the property grid control completely. We think this task should be really solved by coding a new synchronization method which assumes the property tree store is not changed but some property values/categories in it have changed their visibility state.

Malcolm D Sep 11, 2007 - 6:17 PM

As I mention in the first post I have already asked this question, and also aswered your question in
http://www.prof-uis.com/Forum_View.aspx?CID=29&M=56525 (the link might have been broken in the previous post)

The main reason I am calling PropertyStoreSyncronizeAll is that I need to change the visibility of some items via an overloaded "CExtPropertyGridCell::CanBeInsertedIntoPropertyGrid", so in the Apply function I call my own update function for the entire grid which sets the correct visibility of items for the current state, and then call PropertyStoreSynchronizeAll.

The problem is using PropertyStoreSynchronizeAll causes the problems mentioned previously. I was hoping that just changing the visibility of items instead of recreating the all properties everytime might be the way to go, but I still need to use PropertyStoreSynchronizeAll as far as I can tell.

I have some properties which affect the visibility of other items.

I also have some properties where the active and/or the default value needs to change - these might not require a call to PropertyStoreSynchronizeAll, though a possible complicating factor is that I might later be using Combination Stores.

Technical Support Sep 12, 2007 - 12:49 PM

We do not support the PropertyStoreSynchronize()-like API for updating the property grid control partially because in most cases the tree structure of the property store is changed completely. The updated version of grid controls in the current source code 2.81 (including the tree grid windows used in the property grid control) support invisible rows and columns. So, we can assume your last message in this thread as a feature request.

Technical Support Sep 10, 2007 - 1:21 PM

The property grid is designed as a container for one or more tree grid windows displaying the content of property store’s tree in different ways. The tree grids contain cloned copies of grid cells from the property values in property store’s tree. The CExtPropertyGridCtrl::PropertyStoreSynchronize() method re-creates the content of the tree grids completely because it assumes the tree structure of property store can be different. If your application changes only some property values then it should update only grid cells of these property values. Please provide us with more information about your task so we can find the best possible solution for you.