uitypeeditor - C# UI Design time Type Editor for Lists -
this first time working type editors, have created type editor , managed access @ design time, however, not behave way want to, in fact, think nothing @ all. appreciate if can take time , guide me. thanks!
my code typeconverter
public class browselayouttypeconvertor : typeconverter { public browselayouttypeconvertor() { } public override bool getpropertiessupported(itypedescriptorcontext context) { return true; } public override propertydescriptorcollection getproperties(itypedescriptorcontext context, object value, attribute[] attributes) { return typedescriptor.getproperties(typeof(browselayoutcolumns)); } }
my code browselayoutcolumns
[typeconverter(typeof(browselayouttypeconvertor))] public class browselayoutcolumns { private string _columnname; public string columnname { => _columnname; set { if (null == value) return; _columnname = value; } } private string _bindingfield; public string bindingfield { => _bindingfield; set { if (null != value) { _bindingfield = value; } } } public override string tostring() { return "columns"; } }
this how use it:
class mybrowsefrm<tentity>:form tentity:class { #region myproperties private list<browselayoutcolumns> _browselayoutcolumns = new list<browselayoutcolumns>(); [designerserializationvisibility(designerserializationvisibility.content)] [category("design")] public list<browselayoutcolumns> browselayoutcolumns { => _browselayoutcolumns; set { _browselayoutcolumns = value; myrequerygridview(); } } } private void myrequerygridview() { mygridview1.rows.clear(); foreach (var column in _browselayoutcolumns) { mygridview1.columns.add(column.bindingfield, column.columnname); } mygridview1.refresh(); }
i have 2 problems here
1- following error.
2- if restart visual studio, can set values yet no visual changes appear happen on form
what missing here? appreciated! thanks!
Comments
Post a Comment