I have a property grid and need to modify the data dynamically, so that different properties get different开发者_开发百科 drop down menus (the entries in the dropdown are not known at design time). I already tried the method described in the post How to modify PropertyGrid at runtime (add/remove property and dynamic types/enums).
Now, my problem is the following: I implemented the TypeConverter as described in the post. But the propertyGrid greys out the property and doesn't show a dropdown. I tried that with the exact same code as in the example. When using the sample project, it works fine, but integrating it into my own project the dropdown doesn't show.
Does anybody know, if there are any application settings or something like that, which could cause this effect? I already checked framework version, but so far I didn't find anything.
In my solution, I use the Microsoft Visualization SDK and that framework has problems with custom typeconverters. Only if you clean the solution and rebuild, the custom typeconverter works from time to time.
So, the final solution was: Creating a new DLL project (in my case, this DLL can't be part of the original solution) and add a reference to it and everything works fine.
As far as I know, a bug has already been reported for this issue, but obviously wasn't fixed until now.
精彩评论