
Hi Martin,
This type of behavior isn't directly supported by the native WinForms PropertyGrid, so it's not support by our PropertyGrid when using things like the TypeConverter. It can be done with our PropertyGrid, but requires a custom DataFactory and a custom IPropertyDataAccessor
The steps would be:
1. Create a class that derives from PropertyDataAccessorBase and implements the abstract members, say CustomPropertyDataAccessor. This class will reference another IPropertyDataAccessor and will forward all calls to that instance. So the constructor of this class will take an IPropertyDataAccessor that it is wrapping.
2. The only exceptions to #1 are StandardValues and StandardValuesAsStrings. Our default implementations of these properties cache the collection returned. So you need to implement it such that it will return the current collection every time (or if #3 is called, you can reset a cache of your own).
3. In the constructor of #1, you would attach to the NotifyCollectionChanged event of the Projects collection. The Target property will contain your Solution. In the event handler, you would need to call OnPropertyChanged("StandardValues") and OnPropertyChanged("StandardValuesAsStrings"). This step notifies the attached ComboBox that it's items has changed.
4. Create a class that derives from TypeDescriptorFactory or TypeReflectionFactory (depending on which one you are using).
5. Override GetProperties(object, DataFactoryOptions), which calls the base method. Your implementation will then go through the collection returned from the base method, and will wrap the IPropertyDataAccessor for "StartupProject" with an instance of #1.
6. Update your PropertyGrid.DataFactory to use an instance of #4.
You could also use attributes to make this a bit more dynamic. Meaning you could have say CustomAttribute(string associatedCollectionProperty) decorating your StartupProject, then look for that in your DataFactory/PropertyDataAccessor.
Hope this makes sense.