winforms - C# adding collection of custom properties from the property grid at design time -




i have issue of not being able add created columns collection of type.

i have following property:

public observablecollection<browselayoutcolumns> _browselayoutcolumns = new observablecollection<browselayoutcolumns>();     [category("design")]     public observablecollection<browselayoutcolumns> browselayoutcolumns     {         { return _browselayoutcolumns; }         set { _browselayoutcolumns = value; }     }  

browselayoutcolumns

[typeconverter(typeof(browselayoutcolumns))]    public class browselayoutcolumns : datagridviewcolumn {     #region properties      public string columnname { get; set; }     public string bindingfield { get; set; }     #endregion      public browselayoutcolumns()         : base(new datagridviewtextboxcell())     {     }      public override object clone()     {         var copy = base.clone() browselayoutcolumns;         copy.columnname = columnname;         copy.bindingfield = bindingfield;                     return copy;     }         } 

so on design time:

enter image description here

after press ok button.

enter image description here

this happens , wanted happen

the problem compiler :

private void initializecomponent()     {         this.browselayoutcolumns1 = new mybaseframework.mytypeeditors.browselayoutcolumns();         this.suspendlayout();         //          // browselayoutcolumns1         //          this.browselayoutcolumns1.bindingfield = "test";         this.browselayoutcolumns1.columnname = "test";         this.browselayoutcolumns1.name = "browselayoutcolumns1";         //          // browsecontacts_base         //          this.clientsize = new system.drawing.size(606, 447);         this.name = "browsecontacts_base";         this.resumelayout(false);     } 

why not following too?

browselayoutcolumns.add(browselayoutcolumns1); 

what missing? beneficial! in advance





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -