B
Bruce Wood
I have an absolutely freakish problem that is driving me nuts.
I created a user control that encapsulates a ListView. I exposed many
of the ListView properties through the user control, something like
this:
[DefaultValue(false), Category("Appearance"), Description("...")]
public bool CheckBoxes
{
get { return this._listView.CheckBoxes; }
set { this._listView.CheckBoxes = value; }
}
This particular property, CheckBoxes, appears in the property grid in
the Designer. If I change its value, the Designer generates the correct
code:
this._listViewForSelfKeyedCollection1.CheckBoxes = true;
However, if I close the Designer window for the user control that I'm
designing (which contains the "list view" user control) and reopen it,
the list view disappears. If I then go into the Designer generated code
and remove that one line, the list view user control reappears on the
designed user control.
If I try to retype the line by hand into the Designer generated code, I
get this far:
this._listViewForSelfKeyedCollection1.
and Intellisense shows me the available methods and properties, but the
CheckBoxes property _isn't on the list_!
There is something freaky about this property: if I don't set it, the
list view user control appears in the Designer window and all is well.
If I do set it, the Designer hates my "list view" user control and
removes it from the user control I'm designing.
Has anyone run across this sort of weird behaviour? What causes it? I'm
completely stumped.
I created a user control that encapsulates a ListView. I exposed many
of the ListView properties through the user control, something like
this:
[DefaultValue(false), Category("Appearance"), Description("...")]
public bool CheckBoxes
{
get { return this._listView.CheckBoxes; }
set { this._listView.CheckBoxes = value; }
}
This particular property, CheckBoxes, appears in the property grid in
the Designer. If I change its value, the Designer generates the correct
code:
this._listViewForSelfKeyedCollection1.CheckBoxes = true;
However, if I close the Designer window for the user control that I'm
designing (which contains the "list view" user control) and reopen it,
the list view disappears. If I then go into the Designer generated code
and remove that one line, the list view user control reappears on the
designed user control.
If I try to retype the line by hand into the Designer generated code, I
get this far:
this._listViewForSelfKeyedCollection1.
and Intellisense shows me the available methods and properties, but the
CheckBoxes property _isn't on the list_!
There is something freaky about this property: if I don't set it, the
list view user control appears in the Designer window and all is well.
If I do set it, the Designer hates my "list view" user control and
removes it from the user control I'm designing.
Has anyone run across this sort of weird behaviour? What causes it? I'm
completely stumped.