CollectionEditor
-
How do I open a Collection Editor for a property in code? I know how to open if via the property editor. I want to force it open via code. Obviously it's doable, because VS.NET is doing it in the property editor. Any ideas? Kyosa Jamie Nordmeyer - Cho Dan Portland, Oregon, USA
-
How do I open a Collection Editor for a property in code? I know how to open if via the property editor. I want to force it open via code. Obviously it's doable, because VS.NET is doing it in the property editor. Any ideas? Kyosa Jamie Nordmeyer - Cho Dan Portland, Oregon, USA
Jamie Nordmeyer wrote: Obviously it's doable, because VS.NET is doing it in the property editor I think that is part of the Visual Studio IDE and not part of the .NET Framework.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871)
-
How do I open a Collection Editor for a property in code? I know how to open if via the property editor. I want to force it open via code. Obviously it's doable, because VS.NET is doing it in the property editor. Any ideas? Kyosa Jamie Nordmeyer - Cho Dan Portland, Oregon, USA
-
Add the Editor attribute to the property, and set it to the type: System.ComponentModel.Design.CollectionEditor I have a symbiotic relationship with my computer.
He's asking how you open it, not attribute your collection class/property with one.
Microsoft MVP, Visual C# My Articles
-
How do I open a Collection Editor for a property in code? I know how to open if via the property editor. I want to force it open via code. Obviously it's doable, because VS.NET is doing it in the property editor. Any ideas? Kyosa Jamie Nordmeyer - Cho Dan Portland, Oregon, USA
VS.NET provides an implementation of the
IWindowsFormsEditorService
thatUITypeEditor
s like the various collection editors use. It's not a simple question of just showing the form. First, callTypeDescriptor.GetEditor
with either the object or Type for which you want to get the collection editor. Cast that to aUITypeEditor
. If notnull
, callUITypeEditor.EditValue
passing an implementation of theIServiceProvider
- which you must implement - along with the collection to edit. In your implementation for theIServiceProvider
, you must return an instance (could be the same instance) when theIWindowsFormsEditorService
is requested, which you would also need to implement. This is what the specificUITypeEditor
uses to display its collection editor form.Microsoft MVP, Visual C# My Articles
-
VS.NET provides an implementation of the
IWindowsFormsEditorService
thatUITypeEditor
s like the various collection editors use. It's not a simple question of just showing the form. First, callTypeDescriptor.GetEditor
with either the object or Type for which you want to get the collection editor. Cast that to aUITypeEditor
. If notnull
, callUITypeEditor.EditValue
passing an implementation of theIServiceProvider
- which you must implement - along with the collection to edit. In your implementation for theIServiceProvider
, you must return an instance (could be the same instance) when theIWindowsFormsEditorService
is requested, which you would also need to implement. This is what the specificUITypeEditor
uses to display its collection editor form.Microsoft MVP, Visual C# My Articles
Thanks Heath. That did the trick! Kyosa Jamie Nordmeyer - Cho Dan Portland, Oregon, USA