c# - List is not updated when multiple objects are selected in PropertyGrid -


i trying solve issue multiple objects same type selected in property grid. these objects provide array of strings. during investigations, figured out array can not edited user switched list , using custom editor edit these strings. seems work okay ponders me @ moment property not updated in neither of selected objects.

let's go detail simple , short example. let's you've got class:

public class myproperties {     private list<string> _channels;      public myproperties()     {         _channels = new list<string>();     }      [editor(@"system.windows.forms.design.stringcollectioneditor," +     "system.design, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a",    typeof(system.drawing.design.uitypeeditor))]     public list<string> channels     {                 {             return _channels;         }     } } 

i selecting 3 objects of type property grid:

public partial class form1 : form {     private myproperties[] _properties;     public form1()     {         initializecomponent();          _properties = new myproperties[3];         (int = 0; < _properties.length; ++i)             _properties[i] = new myproperties();          propertygrid1.selectedobjects = _properties;     } } 

now, when i'm starting example, able open proper string list editor edit channel list. when clicking , none of myproperties objects contains configured list of strings.

the above example works without problems when selecting single instance of myproperties:

propertygrid1.selectedobject = _properties[0]; 

is there i'm doing wrong or more required work? thank in advance efforts!


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -