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 » PropertyGrid question Collapse All
Subject Author Date
Torsten Ihben Sep 12, 2005 - 9:00 AM

Hi!

We are working with the property grid with many categories and items, so to keep the property view simple for the user all categories are initially collapsed. Now the user expands them and changes some values.

My problem is: I don’t know how I can update values and states of the property items other then calling PropertyStoreSynchronizeAll - however, this results in collapsing all categories, very annoying for the user.

So my question is: Is there a different way to update the property items so that the grid is not built from scratch with initial collapse state? And if there is no other way: Can I somehow retrieve the current collapse state of a single PropertyStoreItem or Category?

Regards, Torsten Ihben

Technical Support Sep 13, 2005 - 8:19 AM

The latest version of the property grid control remembers the expanded state of the property items. Just take a look at the latest versions of the PropertyGrid and CompoundProperties applications. Besides both the expanded state and focus are now synchronized in both sorted and categorized grids. So, this let you avoid unnecessary property store synchronizations.

Torsten Ihben Sep 13, 2005 - 9:12 AM

Oh, I have forgotten something important: How can I get the source code of the CompoundProperties sample? It is not included in the trial download (although the information besides this download says ’includes full source code of samples’).

And can you tell me how to get access to the current expand state of a category? Is this possible? This would be a quick hack, since we are somewhat under pressure...

Regards,
Torsten Ihben

Technical Support Sep 14, 2005 - 9:57 AM

Please send us an e-mail and we will tell you how to download the latest trial build including source code for all the sample applications via ftp.

The CExtPropertyItem::ExpandedGet() and CExtPropertyItem::ExpandedSet() methods allow you to manage the expanded state of property categories. These methods do not affect the expanded state of categories being inserted and displayed by the grid windows inside the property grid control. You can use them for specifying the initial expanded state only.

Torsten Ihben Sep 13, 2005 - 9:08 AM

Good evening ;-)

I cannot find anything similar to this in the latest PropertyGrid example: When I do something that forces the grid to be updated (e.g. select a different star) the expanded state is reset. However, I could not find a different action besides selecting a different star.

In the demo CompoundProperties this action results to the same effect. But in this demo there is a different aspect that is interesting for me: How is the synchronization between two properties realized? When I select a different color in the color chooser the three properties for red, green and blue are updated automatically but the grid is not redrawn, or the expanded state is saved.

Regards,
Torsten Ihben

Technical Support Sep 14, 2005 - 9:46 AM

In the sample applications we mentioned in our previous message, the expanded state is saved only for non-mixed property stores, by selecting Star at top-left, Star at top-right, Star at bottom-left, or Star at bottom-right item in the combo box. We have tried to make the property grid control detect the expanded state for any property items, including those organized into combined property stores. Please download the updated samples.

Please provide us with more details about value input in the compound color cell because we found no problems with this regard or simply did not understand what you mean.

We have coded two new sample applications since Prof-UIS 2.40 was released: TabbedBars and CompoundProperties. Just drop us an e-mail and we will provide you with the latest trial via FTP.

Torsten Ihben Sep 14, 2005 - 10:18 AM

Ok, I think you don’t understand what I want to know...

We have a set of properties and categories. Initially only one category is displayed, but the user can turn on and off the other categories as well. Initially, those are collapsed if they are turned on.

What we need is, when the user turns on some categories, expands them and then turns on some more, the already expanded categories should stay expanded. But since we don’t know a different way to update the grid we use PropertyStoreSyncronizeAll which resets the expanded state to the initial values. Therefore querying and setting the expand state would be a workaround, a better solution would be if the grid itself could store the expanded state during a refresh. Perhaps there is a different way to refresh the content of the property grid?

The eMail for the samples is on the way...

Regards, Torsten Ihben

Technical Support Sep 16, 2005 - 12:13 PM

First of all, the property grid was designed for showing/editing properties of one or several business objects in your application as it is done in the property grid window of the Visual Studio .NET. If the number of properties or the category structure of some object is changed, then you should synchronize the property grid window. The latest source code for this control (available via e-mail requests and updated each 3-4 days) saves the expanded state of property items and you should not have problems with this. But please make sure that you do not recreate completely property trees for your objects. Besides, property values and categories are enabled to be hidden in the property grid control. The CExtPropertyItem::CanBeInsertedIntoPropertyGrid() virtual method allows you to display only particular object properties in the property grid control.

PS We sent you instructions on how to download the latest library code via ftp yesterday. This zip file also includes the updated code for these samples. We assume you already downloaded it. You can also can download a newer (today’s) version from there. We also published a new article about the property grid.

Torsten Ihben Sep 19, 2005 - 1:02 AM

Good morning!

I downloaded the latest version of the samples, but I was unable to build them. I get linker errors, e.g. "MainDlg.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall CExtPropertyValue::Reset(void)" (?Reset@CExtPropertyValue@@UAE_NXZ)". After I downloaded the new files I built the ProfUISDLL and ProfUISLib project. What is missing?

Regards,
Torsten Ihben

Technical Support Sep 19, 2005 - 3:16 AM

Please invoke the Rebuild command for profuisdll and profuislib projects. This will renew the program database files and the linker will be able to see the new CExtPropertyValue::Reset() method.

Torsten Ihben Sep 19, 2005 - 3:25 AM

I did this, but the sample won’t link, I get the same error.

Technical Support Sep 19, 2005 - 8:50 AM

The CExtPropertyValue::Reset() method should present in the .../Prof-UIS/Src/ExtPropertyGridWnd.cpp file. Please check this. If not, then you unpacked the source code update incorrectly.

Torsten Ihben Sep 19, 2005 - 9:58 AM

Hi!

The file is present at the correct location, the class and function is defined correctly.

fyi: I have installed version 2.40, then unpacked the newest version downloaded from ftp to the install directory.

btw: Could you add a direct link to the message or at least to the page in the forum to the notification email? And how about setting a cookie so that I don’t have to login everytime I reload the forum?

Regards, Torsten Ihben

Technical Support Sep 19, 2005 - 12:07 PM

We may guess the problem is really simple but hardly visible like some typo. What do you think about connecting to your desktop remotedly so that we can fix this problem directly on your machine? If you do not mind, just drop us an e-mail. We will you instructions how set up a web conference by e-mail.