I’m replacing my property grid with something that will allow me to customize my UI a bit better. I placed a button on my form that I hope when clicked would pop up a CollectionEditor and allow me to modify my code. When I was using the PropertyGrid, all I needed to do was add some attributes to the property pointing to my CollectionEditor and it worked. But how do I invoke the CollectionEditor manually? Thanks!
Share
Found the answer here: http://www.devnewsgroups.net/windowsforms/t11948-collectioneditor.aspx
Just in case the site linked above goes away some day, here’s the gist of it. The code is verbatim from the link above, however; the comments are mine.
Assume you have a form with a ListBox and a button. If you wanted to edit the items in the ListBox using the CollectionEditor, you would do the following in your EventHandler:
Now the next thing you need to do is to create the RuntimeServiceProvider(). This is the code the poster in the link above wrote to implement this: