I create a control with a property with type of (DataGridView开发者_JAVA技巧ColumnColection). For setting this component at design time, I create a custom designer. At design time every thing is ok. I can create columns, change details and so on but at run time all of my setting will disappear. I guess that problem is in the code serialization. My setting dosen't get serialized in initializecomponent method.
You can download some parts of my project from here:
http://rapidshare.com/files/452543887/Training.zip
In student form properties you can see a property(MasterColumns), this property controls datagridview columns at design time correctly, but in run time... you can see.. Please Help Me
You need to use the DesignerSerializationVisibility attribute. Here is a C++ example :-
private: int fullWidth;
public:
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility::Visible)]
property int FullWidth
{
int get() { return this->fullWidth; }
void set(int width) {
this->fullWidth = width;
}
}
精彩评论