Discussion:
User Type Property in the designer.
(too old to reply)
Patricio Vidal
2008-04-02 00:07:42 UTC
Permalink
Hello,

I have a user control that has a custom type public property. I added de
Browsable attribute so that it appears in the designer. When I drop that
control on another control or form the custom type property is visible but I
can not assigned to one of the container fields. If I use a know type
(ListView for example) then the property has a pull down menu showing me
those fields in the container that matches the type, but with my custom type
the pull down menu only has "none". How do I solve this?

Thank you for your help,
Patricio.
Linda Liu[MSFT]
2008-04-02 08:07:34 UTC
Permalink
Hi Patricio,

Based on my understanding, you have a user control that contains a public
property of a custom type. When you drag the user control on a form, the
public custom type property is shown in the Properties window but the sub
properties of the custom type are not shown under the custom type property,
ie. the custom type property is not expandable. If I'm off base, please
feel free to let me know.

You need to apply the ExpandableObjectConverter to the custom type to make
the custom type property expandable. For example:

[TypeConverter(typeof(ExpandableObjectConverter))]
public class Person
{
private string id;
private string name;
public string ID
{
get { return id; }
set { id = value; }
}
public string Name
{
get { return name; }
set { name = value; }
}
}

In addition, you must expose a ShouldSerializePropertyName method that
returns a bool in the user control to enable serialization of properties of
complex types. Internally, the Windows Forms Designer looks for a method
named ShouldSerializePropertyName to ask whether the property should be
serialized. From the Windows Forms Designer's point of view, it doesn't
matter whether your ShouldSerializePropertyName is public or private, but
choosing private removes it from client visibility.

For example:
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
}
private Person p = new Person();
public Person P
{
get { return p; }
set { p = value; }
}
bool ShouldSerializeP()
{
return true;
}
}

Hope this helps.
If you have any question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
***@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Patricio
2008-04-02 18:03:30 UTC
Permalink
Hello Linda,

Thank you for your answer.

Actually, I think what I want is simpler than that. I just want the
Property Browser to allow the user to connect the User Control property to
one of the Host fields. For known types this works by default.

I am attaching a sample solution to show what I mean. You can see that in
the Form1 design view, when the UserControl1 is selected, the Property
Browser allows the user to select the listView1 field as the value for the
ListView property, but the same does not happens for the CustomType.

I tried the TypeConverter and the "ShouldSerialize" and it did not worked.
I'm using VS2008.

Please let me know what else can I try. Thank you,
Patricio.
Post by Linda Liu[MSFT]
Hi Patricio,
Based on my understanding, you have a user control that contains a public
property of a custom type. When you drag the user control on a form, the
public custom type property is shown in the Properties window but the sub
properties of the custom type are not shown under the custom type property,
ie. the custom type property is not expandable. If I'm off base, please
feel free to let me know.
You need to apply the ExpandableObjectConverter to the custom type to make
[TypeConverter(typeof(ExpandableObjectConverter))]
public class Person
{
private string id;
private string name;
public string ID
{
get { return id; }
set { id = value; }
}
public string Name
{
get { return name; }
set { name = value; }
}
}
In addition, you must expose a ShouldSerializePropertyName method that
returns a bool in the user control to enable serialization of properties of
complex types. Internally, the Windows Forms Designer looks for a method
named ShouldSerializePropertyName to ask whether the property should be
serialized. From the Windows Forms Designer's point of view, it doesn't
matter whether your ShouldSerializePropertyName is public or private, but
choosing private removes it from client visibility.
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
}
private Person p = new Person();
public Person P
{
get { return p; }
set { p = value; }
}
bool ShouldSerializeP()
{
return true;
}
}
Hope this helps.
If you have any question, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
begin 666 CustomTypeProperty.zip
M4$L#! H``````*)***@C@````````````````7````0W5S=&]M5'EP95!R;W!E
M<G1Y+V)I;B]02P,$"@``````Q&F". ```````````````!T```!#=7-T;VU4
M>7!E4')O<&5R='DO8FEN+T1E8G5G+U!+`P04````" "':H(X4^30.,D```"+
M`0``( ```$-U<W1O;51Y<&50<F]P97)T>2]#=7-T;VU4>7!E+F-SC5"]"L(P
M$-X+?8>,=>D+.$D5%T7!;N*0QK-$TKN8I&H1G\S!1_(53*R44A<A'/?]72YY
M/9ZUE5BR36,=5.,XZL,T(Z5 .$EHTSD@&"F&EH7$TY#+X>J&W-3PBX>_-U2:
M$- M:0_*JW&$O *KN0"6U=91E3<:UH8T&-?$T2V.&-L&+B,\>PY,XCRB0S*[
M:HY[7BA8%4>_=F<8C78AI>M"2<&$XM;V9@?I,[5S2'1LTC)?@;$2PI/:WG;]
M/2S<2_H/(]/6?_.?XL\;4$L#!!0````(`-=***@CAE< &6D00``,8/```L````
M0W5S=&]M5'EP95!R;W!E<G1Y+T-U<W1O;51Y<&50<F]P97)T>2YC<W!R;VK%
M5U]OVS80?Q^P[\ )!=("***@K%=H(`:1/8SMJ'O-#6R>$JD2I))?'6
M?;(]["/M*^PHB[84V[%:;.B+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VI\"-B'1T &9E40XD))P.Q*L=D0:IN;KL>AD!.0I5E,2+B]A-9/IQ:C3>EW0
M4QG,U*Q*I_6FI!_*RTZD>4O^/,0)^% ,>,G8*;(PF0>WY0(Z3+\BK]<D0__E
MV'1!!L.>)+3$9RH?G2,.\!HD@:4`AJ1J^UEY4CJUL6'8GMKTK7RA.JJP/P&2
MQ"A5(/Z/LQR\N+,J_RO4-YPV7#UUXO%YXO$O!SW=\TSN/&;U-@:Z;X3&C$L4
MI_(ORDHZ^NH=L7D"2C$;_K "K1S=R-\IG)[?4$L#! H``````%***@C@`````
M```````````3````0W5S=&]M5'EP95!R;W!E<G1Y+U!+`0(4``H``````*)I
***@C@````````````````7````````````$ ````````!#=7-T;VU4>7!E4')O
M<&5R='DO8FEN+U!+`0(4``H``````,***@C@````````````````=````````
M````$ ```#4```!#=7-T;VU4>7!E4')O<&5R='DO8FEN+T1E8G5G+U!+`0(4
M`!0````(`(=***@CA3Y- XR0```(L!```@``````````$`( ```' ```!#=7-T
M;VU4>7!E4')O<&5R='DO0W5S=&]M5'EP92YC<U!+`0(4`!0````(`-=***@CAE
M< &6D00``,8/```L``````````$`( ```'<!``!#=7-T;VU4>7!E4')O<&5R
M='DO0W5S=&]M5'EP95!R;W!E<G1Y+F-S<')O:E!+`0(4`!0````(`&***@CC'
MA?PK80$``)T#```I``````````$`( ```%(&``!#=7-T;VU4>7!E4')O<&5R
M='DO0W5S=&]M5'EP95!R;W!E<G1Y+G-L;E!+`0(4`!0````(`%***@C@Y:%Q1
MU ```),!```;``````````$`( ```/H'``!#=7-T;VU4>7!E4')O<&5R='DO
M1F]R;3$N8W-02P$"% `4````" !4;8(X:!SH?B<#``!7"0``) `````````!
M`" ````'"0``0W5S=&]M5'EP95!R;W!E<G1Y+T9O<FTQ+D1E<VEG;F5R+F-S
M4$L!`A0`% ````@`5&V".*(_F+K.!0``MA8``!T``````````0`@````< P`
M`$-U<W1O;51Y<&50<F]P97)T>2]&;W)M,2YR97-X4$L!`A0`"@``````8VF"
M. ```````````````!<````````````0````>1(``$-U<W1O;51Y<&50<F]P
M97)T>2]O8FHO4$L!`A0`"@``````0&^". ```````````````!T`````````
M```0````KA(``$-U<W1O;51Y<&50<F]P97)T>2]O8FHO1&5B=6<O4$L!`A0`
M"@``````8VF". ```````````````"0````````````0````Z1(``$-U<W1O
M;51Y<&50<F]P97)T>2]O8FHO1&5B=6<O5&5M<%!%+U!+`0(4`!0````(`&-I
***@CBF3F9^#0$``,H!```=``````````$`( ```"L3``!#=7-T;VU4>7!E4')O
M<&5R='DO4')O9W)A;2YC<U!+`0(4``H``````&-***@C@````````````````>
M````````````$ ```',4``!#=7-T;VU4>7!E4')O<&5R='DO4')O<&5R=&EE
M<R]02P$"% `4````" !;;X(X/ODNU?H```!'`@``(@`````````!`" ```"O
M% ``0W5S=&]M5'EP95!R;W!E<G1Y+U5S97)#;VYT<F]L,2YC<U!+`0(4`!0`
M```(`*=***@CA `:IST0$``/L#```K``````````$`( ```.D5``!#=7-T;VU4
M>7!E4')O<&5R='DO57-E<D-O;G1R;VPQ+D1E<VEG;F5R+F-S4$L!`A0`"@``
M````6V^". ```````````````!,````````````0`````Q@``$-U<W1O;51Y
A<&50<F]P97)T>2]02P4&`````! `$ #8! ``-!@`````
`
end
Linda Liu[MSFT]
2008-04-03 09:44:36 UTC
Permalink
Hi Patricio,

Thank you for your prompt reply and sample project!

The reason why the CustomType property doesn't allow the user to select a
value in the Properties window is that the CustomType type is neither a
control nor a component.

If you derive the class CustomType from the Control or Component class, you
should see the CustomType property of the UserControl allows the user to
select a value in the Properites window.

Hope this helps.
If you have any question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
***@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
Linda Liu[MSFT]
2008-04-04 10:40:34 UTC
Permalink
Hi Patricio,

Thank you for your reply!

You should add the CustomType component to the Toolbox if it doesn't appear
in the Toolbox. To do this, right-click on the Toolbox and select 'Choose
Items'. In the 'Choose Toolbox Items' dialog, browse to the assembly that
contains the component and select the checkbox before the component you'd
like and press OK.

Then drag the CustomType component onto the form to add an instance of
CustomType component.

Select the UserControl on the form and click the drop down arrow in the
CustomType property entry in the Properties window. You can select the
CustomType instance as the value.

Hope this helps.
If you have anything unclear, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
***@microsoft.com.
This posting is provided "AS IS" with no warranties, and confers no rights.
Patricio Vidal
2008-04-04 21:03:36 UTC
Permalink
Great! It works! Thank you very much for your help Linda.

Regards,
Patricio.
Post by Linda Liu[MSFT]
Hi Patricio,
Thank you for your reply!
You should add the CustomType component to the Toolbox if it doesn't appear
in the Toolbox. To do this, right-click on the Toolbox and select 'Choose
Items'. In the 'Choose Toolbox Items' dialog, browse to the assembly that
contains the component and select the checkbox before the component you'd
like and press OK.
Then drag the CustomType component onto the form to add an instance of
CustomType component.
Select the UserControl on the form and click the drop down arrow in the
CustomType property entry in the Properties window. You can select the
CustomType instance as the value.
Hope this helps.
If you have anything unclear, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
This posting is provided "AS IS" with no warranties, and confers no rights.
Continue reading on narkive:
Loading...