Windows Develop Bookmark and Share   
 index > Windows Forms Designer > PropertyGrid & UITypeEditor
 

PropertyGrid & UITypeEditor

The property grid insists on only using strings to identify which option is selected from a collection, and I need to allow the user to select from a list of strings, and have a GUID returned.

So, Icreated a UITypeEditor so that I could use a ListBox to select options in a PropertyGrid. That way I can fill the listbox with a collection of custom objects that contain a guid, and a string property that is tied to an overridden .ToString()

I figured out how to get my data into the propertygrid, but I can't figure out how to get the grid to select one of the items in the list in response to the values in the object that I attach the grid to.

I've tried doing the selection in the EditValue function, which is where the listbox gets populated, but It doesn't seem to do any good.

What exactly is the best way to handle a key/value collection in a property grid?

Thanks

kettch  Wednesday, November 01, 2006 1:20 AM

Nevermind, I figured out what was causing the problem.

Thanks

kettch  Wednesday, November 01, 2006 4:26 PM

Nevermind, I figured out what was causing the problem.

Thanks

kettch  Wednesday, November 01, 2006 4:26 PM
Can you post your solution? I have the same problem.
integragreg  Wednesday, January 28, 2009 7:13 PM

You can use google to search for other answers

Custom Search

More Threads

• Unable to display Form Designer or build any projects.
• Visual Studio 2005 - How to hide controls in Forms Designer
• MDI Child not loading correct
• Adding EventsTab in propertygrid for customcontrol
• Collection items added but not serialized to code in usercontrol collection property
• Global Assembly Cache (GAC)
• Can you get to the open project or solution files while in a Designer in Design mode
• Child controls are not properly being added to a parent parent control
• Multiple forms and a DataSet
• Non-Primary Monitors, Rotated Monitors & Invalidate / Paint / StretchBlt