You're welcome Mirek,
Good luck!
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: Web Server Control and property tree in design time like
Font
| thread-index: AcXq+3gJJlgif5QpRsKHOdA8lAkZIg==
| X-WBNR-Posting-Host: 86.49.58.229
| From: "=?Utf-8?B?TWlyZWsgRW5keXM=?=" <Mirek
(e-mail address removed)>
| References: <
[email protected]>
<
[email protected]>
<
[email protected]>
| Subject: RE: Web Server Control and property tree in design time like Font
| Date: Wed, 16 Nov 2005 14:17:02 -0800
| Lines: 216
| Message-ID: <
[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:31177
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| Yes, it helps me. You are GURU
| I thought that it will be an attribute. But I didnt know which.
|
| Thanks alot.
|
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Mirek,
| >
| > How are you doing on this? Does the suggestions in my last message
helps
| > you? If there're anything else we can help, please feel free to post
here.
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure!
www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| > --------------------
| > | X-Tomcat-ID: 101422756
| > | References: <
[email protected]>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain
| > | Content-Transfer-Encoding: 7bit
| > | From: (e-mail address removed) (Steven Cheng[MSFT])
| > | Organization: Microsoft
| > | Date: Mon, 14 Nov 2005 06:24:21 GMT
| > | Subject: RE: Web Server Control and property tree in design time like
| > Font has.
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | Message-ID: <
[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | Lines: 119
| > | Path: TK2MSFTNGXA02.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet.webcontrols:31127
| > | NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
| > |
| > | Hi Mirek,
| > |
| > | As for the the making a expandable custom property in our custom
ASP.NET
| > | web server control question you mentioned, I think we need to do the
| > | following thins for our web control and that property:
| > |
| > | 1. As for the property which we want it be expandable, we should use
the
| > | TypeConverter(typeof(ExpandableObjectConverter)),
| > |
| > | attribute to mark it so that IDE can use expandableObjectConvevter to
| > | parsing it hierarchially.
| > |
| > | 2. As for a property in a webserver control, we still need to make it
| > | persisted in inline html as inner property or attrirbute, so the
| > | PersisteMode and DesignerSerializationVisibility attribute are also
| > needed.
| > |
| > |
| > | To make it clearly, here is a example I've made and worked well in my
| > local
| > | enviornment (VS.NET 2005 PRO, WIN2K3 .NET 2.0....)
| > |
| > | Hope helps. Thanks,
| > |
| > | Steven Cheng
| > | Microsoft Online Support
| > |
| > | Get Secure!
www.microsoft.com/security
| > | (This posting is provided "AS IS", with no warranties, and confers no
| > | rights.)
| > |
| > | ============================
| > | using System;
| > | using System.Collections.Generic;
| > | using System.ComponentModel;
| > | using System.Text;
| > | using System.Web;
| > | using System.Web.UI;
| > | using System.Web.UI.WebControls;
| > | using System.ComponentModel.Design;
| > | using System.Drawing.Design;
| > | using System.Web.UI.Design;
| > |
| > |
| > | namespace ControlLibrary
| > | {
| > |
| > | [
| > | ToolboxData("<{0}:CustomPropertyControl
| > | runat=server></{0}:CustomPropertyControl>"),
| > | Designer(typeof(CustomPropertyControlDesigner)), Serializable()]
| > | public class CustomPropertyControl : WebControl
| > | {
| > |
| > | private MyName _username = new MyName();
| > |
| > | [Browsable(true), NotifyParentProperty(true),
| > | PersistenceMode(PersistenceMode.InnerProperty),
| > |
| > |
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
| > | public MyName UserName
| > | {
| > | get
| > | {
| > | return _username;
| > | }
| > | set
| > | {
| > | _username = value;
| > | }
| > |
| > | }
| > |
| > | protected override void RenderContents(HtmlTextWriter output)
| > | {
| > |
| > |
| > | if(UserName != null)
| > | output.Write("<br>Name: " + UserName.FirstName + ", " +
| > | UserName.LastName);
| > | }
| > | }
| > |
| > |
| > | [TypeConverter(typeof(ExpandableObjectConverter)),
| > | Browsable(true),
| > | Category("Data"),
| > | RefreshProperties(RefreshProperties.Repaint),
| > | Serializable(),
| > | DefaultPropertyAttribute("FirstName"),
| > | ToolboxItem(false),
| > | Description("UserName Property class")]
| > | public class MyName
| > | {
| > | private string _fname;
| > | private string _lname;
| > |
| > | public MyName()
| > | {
| > | _fname = string.Empty;
| > | _lname = string.Empty;
| > | }
| > |
| > | public MyName(string firstname, string lastname)
| > | {
| > | _fname = firstname;
| > | _lname = lastname;
| > | }
| > |
| > | [NotifyParentProperty(true)]
| > | public string FirstName
| > | {
| > | get { return _fname; }
| > | set { _fname = value; }
| > | }
| > |
| > | [NotifyParentProperty(true)]
| > | public string LastName
| > | {
| > | get { return _lname; }
| > | set { _lname = value; }
| > | }
| > | }
| > |
| > |
| > | public class CustomPropertyControlDesigner : ControlDesigner
| > | {
| > | public override string GetDesignTimeHtml()
| > | {
| > | return "<br/><font size='20'>CustomPropertyControl
| > Design-Time
| > | HTML.</font>";
| > | }
| > | }
| > | }
| > | =============================================
| > | --------------------
| > | | From: "Mirek Endys" <
[email protected]>
| > | | Subject: Web Server Control and property tree in design time like
Font
| > | has.
| > | | Date: Fri, 11 Nov 2005 16:23:19 +0100
| > | | Lines: 13
| > | | X-Priority: 3
| > | | X-MSMail-Priority: Normal
| > | | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| > | | X-RFC2646: Format=Flowed; Original
| > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| > | | Message-ID: <
[email protected]>
| > | | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | | NNTP-Posting-Host: gw.coty.cz 195.47.52.129
| > | | Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | | Xref: TK2MSFTNGXA02.phx.gbl
| > | microsoft.public.dotnet.framework.aspnet.webcontrols:31086
| > | | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | |
| > | | I have Web Server Control and I have there a property that is
myClass
| > | type.
| > | | I want to display this property in design time property toolbox as
| > | property
| > | | type Font: each public property of myClass type to show in tree
(like
| > | Font
| > | | properties).
| > | |
| > | | What should I to do??
| > | |
| > | | Thanks
| > | |
| > | | Mirek
| > | |
| > | |
| > | |
| > | |
| > |
| > |
| >
| >
|