<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Hosting Open Forum</title><link>http://forums.asp.net/158.aspx</link><description>General discussions concerning ASP.NET in a Windows Hosting environment</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Custom Control With Multiple Properties of Collection Type</title><link>http://forums.asp.net/thread/641439.aspx</link><pubDate>Tue, 20 Jul 2004 22:00:24 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:641439</guid><dc:creator>superconsultant</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/641439.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=158&amp;PostID=641439</wfw:commentRss><description>It worked Dan!
&lt;br /&gt;

&lt;br /&gt;
Thank you very much.
&lt;br /&gt;

&lt;br /&gt;
Regards,
&lt;br /&gt;
Dimitry</description></item><item><title>Re: Custom Control With Multiple Properties of Collection Type</title><link>http://forums.asp.net/thread/641183.aspx</link><pubDate>Tue, 20 Jul 2004 18:26:51 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:641183</guid><dc:creator>danfizesan</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/641183.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=158&amp;PostID=641183</wfw:commentRss><description>Delete the &amp;quot;Set&amp;quot; accesor to the UserInfos property and you'll be fine.
&lt;br /&gt;

&lt;br /&gt;
Leave it as follows :
&lt;br /&gt;

&lt;br /&gt;
Public Property UserInfos() As UserCollection 
&lt;br /&gt;
Get
&lt;br /&gt;
    Return _userCollection
&lt;br /&gt;
End Get 
&lt;br /&gt;
End Property 
&lt;br /&gt;

&lt;br /&gt;
Best regards,
&lt;br /&gt;
Dan</description></item><item><title>Re: Custom Control With Multiple Properties of Collection Type</title><link>http://forums.asp.net/thread/640999.aspx</link><pubDate>Tue, 20 Jul 2004 16:20:02 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:640999</guid><dc:creator>superconsultant</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/640999.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=158&amp;PostID=640999</wfw:commentRss><description>Andy,
&lt;br /&gt;

&lt;br /&gt;
It seems I found the problem:
&lt;br /&gt;

&lt;br /&gt;
PersistenceMode(PersistenceMode.InnerDefaultProperty) that I have there should be changed to PersistenceMode(PersistenceMode.InnerProperty). That made it to look correctly, exactly the way you have it in your example.
&lt;br /&gt;

&lt;br /&gt;
However I still one strange problem left. When I run a page with my control in it it runs fine, but when I exit Visual Studio.NET and get back my control on a page displayed with the error message: Error Creating Control and tooptip saying: '' could not be set on property 'UserInfos' and it still runs fine, but I can not edit its properties in property panel. 
&lt;br /&gt;

&lt;br /&gt;
If you have any ideas please let me know.
&lt;br /&gt;

&lt;br /&gt;
Regards,
&lt;br /&gt;
Dimitry
&lt;br /&gt;</description></item><item><title>Re: Custom Control With Multiple Properties of Collection Type</title><link>http://forums.asp.net/thread/640906.aspx</link><pubDate>Tue, 20 Jul 2004 15:22:38 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:640906</guid><dc:creator>superconsultant</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/640906.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=158&amp;PostID=640906</wfw:commentRss><description>When I try just ParseChildren(true) what I get using your example:
&lt;br /&gt;

&lt;br /&gt;
&amp;lt;foo:MyControl ... &amp;gt;
&lt;br /&gt;

&lt;br /&gt;
      &amp;lt;foo:Item1 /&amp;gt;
&lt;br /&gt;

&lt;br /&gt;
      &amp;lt;foo:Item2 /&amp;gt;
&lt;br /&gt;

&lt;br /&gt;
      &amp;lt;foo:Item1 /&amp;gt;
&lt;br /&gt;

&lt;br /&gt;
    &amp;lt;foo:Item2 /&amp;gt;
&lt;br /&gt;

&lt;br /&gt;
 &amp;lt;/foo:MyControl&amp;gt;
&lt;br /&gt;

&lt;br /&gt;
where &amp;lt;MyCollectionProperty1&amp;gt; and &amp;lt;MyCollectionProperty2&amp;gt; tags are missing. So when I run it it gives me an error someting like &amp;lt;foo:MyControl&amp;gt; does not have property &amp;lt;foo:Item1/&amp;gt;.
&lt;br /&gt;

&lt;br /&gt;
Maybe if you have time you can take a look at my code bellow and see what's wrong or what tags I am missing:
&lt;br /&gt;

&lt;br /&gt;

&lt;br /&gt;
---------CONTROL CLASS------------
&lt;br /&gt;
Imports System.Web.UI
&lt;br /&gt;
Imports System.ComponentModel
&lt;br /&gt;
&amp;lt;ParseChildren(True), PersistChildren(False), _
&lt;br /&gt;
PersistenceMode(PersistenceMode.InnerProperty), _
&lt;br /&gt;
ToolboxData(&amp;quot;&amp;lt;{0}:EmployeeControl runat=server&amp;gt;&amp;lt;/{0}:EmployeeControl&amp;gt;&amp;quot;)&amp;gt; _
&lt;br /&gt;
Public Class EmployeeControl
&lt;br /&gt;
    Inherits System.Web.UI.WebControls.WebControl
&lt;br /&gt;

&lt;br /&gt;
    Private _empCollection As New EmployeeCollection
&lt;br /&gt;
    Private _userCollection As New UserCollection
&lt;br /&gt;

&lt;br /&gt;
    &amp;lt;Category(&amp;quot;Custom&amp;quot;), NotifyParentProperty(True), _
&lt;br /&gt;
    PersistenceMode(PersistenceMode.InnerDefaultProperty), _
&lt;br /&gt;
    DesignerSerializationVisibility(DesignerSerializationVisibility.Content)&amp;gt; _
&lt;br /&gt;
    Public Property UserInfos() As UserCollection
&lt;br /&gt;
        Get
&lt;br /&gt;

&lt;br /&gt;
            Return _userCollection
&lt;br /&gt;
        End Get
&lt;br /&gt;
        Set(ByVal Value As UserCollection)
&lt;br /&gt;
            _userCollection = Value
&lt;br /&gt;
        End Set
&lt;br /&gt;
    End Property
&lt;br /&gt;

&lt;br /&gt;
    &amp;lt;Category(&amp;quot;Custom&amp;quot;), NotifyParentProperty(True), _
&lt;br /&gt;
   PersistenceMode(PersistenceMode.InnerDefaultProperty), _
&lt;br /&gt;
   DesignerSerializationVisibility(DesignerSerializationVisibility.Content)&amp;gt; _
&lt;br /&gt;
   Public Property EmployeeInfos() As EmployeeCollection
&lt;br /&gt;
        Get
&lt;br /&gt;

&lt;br /&gt;
            Return _empCollection
&lt;br /&gt;
        End Get
&lt;br /&gt;
        Set(ByVal Value As EmployeeCollection)
&lt;br /&gt;
            _empCollection = Value
&lt;br /&gt;
        End Set
&lt;br /&gt;
    End Property
&lt;br /&gt;

&lt;br /&gt;
End Class
&lt;br /&gt;

&lt;br /&gt;
-----------COLLECTION CLASSES-------------
&lt;br /&gt;

&lt;br /&gt;
Imports System.ComponentModel
&lt;br /&gt;
Imports System.Web.UI
&lt;br /&gt;

&lt;br /&gt;
Public Class UserCollection
&lt;br /&gt;
    Inherits CollectionBase
&lt;br /&gt;

&lt;br /&gt;
   Default Public Property Item(ByVal index As Integer) As UserInfo
&lt;br /&gt;
        Get
&lt;br /&gt;
            Return CType(List(index), UserInfo)
&lt;br /&gt;
        End Get
&lt;br /&gt;
        Set(ByVal Value As UserInfo)
&lt;br /&gt;
            List(index) = Value
&lt;br /&gt;
        End Set
&lt;br /&gt;
    End Property
&lt;br /&gt;

&lt;br /&gt;
    Public Function Add(ByVal value As UserInfo) As Integer
&lt;br /&gt;
        Return List.Add(value)
&lt;br /&gt;
    End Function 'Add
&lt;br /&gt;

&lt;br /&gt;
    Public Function IndexOf(ByVal value As UserInfo) As Integer
&lt;br /&gt;
        Return List.IndexOf(value)
&lt;br /&gt;
    End Function 'IndexOf
&lt;br /&gt;

&lt;br /&gt;
    Public Sub Insert(ByVal index As Integer, ByVal value As UserInfo)
&lt;br /&gt;
        List.Insert(index, value)
&lt;br /&gt;
    End Sub 'Insert
&lt;br /&gt;

&lt;br /&gt;
    Public Sub Remove(ByVal value As UserInfo)
&lt;br /&gt;
        List.Remove(value)
&lt;br /&gt;
    End Sub 'Remove
&lt;br /&gt;
End Class
&lt;br /&gt;

&lt;br /&gt;
-----------------------
&lt;br /&gt;

&lt;br /&gt;
Imports System.ComponentModel
&lt;br /&gt;
Imports System.Web.UI
&lt;br /&gt;

&lt;br /&gt;
Public Class EmployeeCollection
&lt;br /&gt;
    Inherits CollectionBase
&lt;br /&gt;

&lt;br /&gt;
    Default Public Property Item(ByVal index As Integer) As EmployeeInfo
&lt;br /&gt;
        Get
&lt;br /&gt;
            Return CType(List(index), EmployeeInfo)
&lt;br /&gt;
        End Get
&lt;br /&gt;
        Set(ByVal Value As EmployeeInfo)
&lt;br /&gt;
            List(index) = Value
&lt;br /&gt;
        End Set
&lt;br /&gt;
    End Property
&lt;br /&gt;

&lt;br /&gt;
    Public Function Add(ByVal value As EmployeeInfo) As Integer
&lt;br /&gt;
        Return List.Add(value)
&lt;br /&gt;
    End Function 'Add
&lt;br /&gt;

&lt;br /&gt;
    Public Function IndexOf(ByVal value As EmployeeInfo) As Integer
&lt;br /&gt;
        Return List.IndexOf(value)
&lt;br /&gt;
    End Function 'IndexOf
&lt;br /&gt;

&lt;br /&gt;
    Public Sub Insert(ByVal index As Integer, ByVal value As EmployeeInfo)
&lt;br /&gt;
        List.Insert(index, value)
&lt;br /&gt;
    End Sub 'Insert
&lt;br /&gt;

&lt;br /&gt;
    Public Sub Remove(ByVal value As EmployeeInfo)
&lt;br /&gt;
        List.Remove(value)
&lt;br /&gt;
    End Sub 'Remove
&lt;br /&gt;
End Class
&lt;br /&gt;

&lt;br /&gt;
------------TYPE CLASSES----------------
&lt;br /&gt;

&lt;br /&gt;
Imports System.ComponentModel
&lt;br /&gt;

&lt;br /&gt;
Public Class UserInfo
&lt;br /&gt;
    Public strFirstName As String = &amp;quot;&amp;quot;
&lt;br /&gt;
    Public strLastName As String = &amp;quot;&amp;quot;
&lt;br /&gt;
    Public iUserId As Integer = 0
&lt;br /&gt;
    Property [FirstName]() As String
&lt;br /&gt;
        Get
&lt;br /&gt;
            Return strFirstName
&lt;br /&gt;
        End Get
&lt;br /&gt;
        Set(ByVal Value As String)
&lt;br /&gt;
            strFirstName = Value
&lt;br /&gt;
        End Set
&lt;br /&gt;
    End Property
&lt;br /&gt;
    
&lt;br /&gt;
    Property [LastName]() As String
&lt;br /&gt;
        Get
&lt;br /&gt;
            Return strLastName
&lt;br /&gt;
        End Get
&lt;br /&gt;
        Set(ByVal Value As String)
&lt;br /&gt;
            strLastName = Value
&lt;br /&gt;
        End Set
&lt;br /&gt;
    End Property
&lt;br /&gt;

&lt;br /&gt;
    Property [UserID]() As Integer 'UserIDCollection
&lt;br /&gt;
        Get
&lt;br /&gt;
            Return iUserId
&lt;br /&gt;
        End Get
&lt;br /&gt;
        Set(ByVal Value As Integer) 'UserIDCollection)
&lt;br /&gt;
            iUserId = Value
&lt;br /&gt;
        End Set
&lt;br /&gt;
    End Property
&lt;br /&gt;
End Class
&lt;br /&gt;

&lt;br /&gt;
----------------
&lt;br /&gt;

&lt;br /&gt;
Imports System.ComponentModel
&lt;br /&gt;

&lt;br /&gt;
Public Class EmployeeInfo
&lt;br /&gt;
    Private strFirstName As String = &amp;quot;&amp;quot;
&lt;br /&gt;
    Private strLastName As String = &amp;quot;&amp;quot;
&lt;br /&gt;
    Private iEmpId As Integer = 0
&lt;br /&gt;

&lt;br /&gt;
    Property [FirstName]() As String
&lt;br /&gt;
        Get
&lt;br /&gt;
            Return strFirstName
&lt;br /&gt;
        End Get
&lt;br /&gt;
        Set(ByVal Value As String)
&lt;br /&gt;
            strFirstName = Value
&lt;br /&gt;
        End Set
&lt;br /&gt;
    End Property
&lt;br /&gt;

&lt;br /&gt;
    Property [LastName]() As String
&lt;br /&gt;
        Get
&lt;br /&gt;
            Return strLastName
&lt;br /&gt;
        End Get
&lt;br /&gt;
        Set(ByVal Value As String)
&lt;br /&gt;
            strLastName = Value
&lt;br /&gt;
        End Set
&lt;br /&gt;
    End Property
&lt;br /&gt;
    
&lt;br /&gt;
    Property [EmployeeId]() As Integer
&lt;br /&gt;
        Get
&lt;br /&gt;
            Return iEmpId
&lt;br /&gt;
        End Get
&lt;br /&gt;
        Set(ByVal Value As Integer)
&lt;br /&gt;
            iEmpId = Value
&lt;br /&gt;
        End Set
&lt;br /&gt;
    End Property
&lt;br /&gt;
End Class
&lt;br /&gt;

&lt;br /&gt;
---------------------------
&lt;br /&gt;
Your help is greately appriciated.
&lt;br /&gt;

&lt;br /&gt;
Thanks and Regards
&lt;br /&gt;

&lt;br /&gt;

&lt;br /&gt;

&lt;br /&gt;

&lt;br /&gt;

&lt;br /&gt;</description></item><item><title>Re: Custom Control With Multiple Properties of Collection Type</title><link>http://forums.asp.net/thread/640427.aspx</link><pubDate>Tue, 20 Jul 2004 06:30:08 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:640427</guid><dc:creator>Andy Smith</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/640427.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=158&amp;PostID=640427</wfw:commentRss><description>that second param is the &amp;quot;default property&amp;quot;. If you only have one collection, you probably want to use it. However, if you have two properties, leave it as ParseChildren( True ).
&lt;br /&gt;
Then your server tag will look like this:
&lt;br /&gt;
&lt;pre&gt;&amp;lt;foo:MyControl ... &amp;gt;
&lt;br /&gt;
  &amp;lt;MyCollectionProperty1&amp;gt;
&lt;br /&gt;
    &amp;lt;foo:Item1 /&amp;gt;
&lt;br /&gt;
    &amp;lt;foo:Item2 /&amp;gt;
&lt;br /&gt;
  &amp;lt;/MyCollectionProperty1&amp;gt;
&lt;br /&gt;
  &amp;lt;MyCollectionProperty2&amp;gt;
&lt;br /&gt;
    &amp;lt;foo:Item1 /&amp;gt;
&lt;br /&gt;
    &amp;lt;foo:Item2 /&amp;gt;
&lt;br /&gt;
  &amp;lt;/MyCollectionProperty2&amp;gt;
&lt;br /&gt;
&amp;lt;/foo:MyControl&amp;gt;&lt;/pre&gt;</description></item><item><title>Custom Control With Multiple Properties of Collection Type</title><link>http://forums.asp.net/thread/640131.aspx</link><pubDate>Mon, 19 Jul 2004 22:26:28 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:640131</guid><dc:creator>superconsultant</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/640131.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=158&amp;PostID=640131</wfw:commentRss><description>Does any one know if it is posible to have more than one propery of collection type on custom server control.
&lt;br /&gt;

&lt;br /&gt;
It seems that it is requred to put property name in to ParseChildere tag of the control, something like:
&lt;br /&gt;
ParseChildren(True, &amp;quot;MyProperty1&amp;quot;) in order for the property items to be recognized. But where would I put second property's name?
&lt;br /&gt;

&lt;br /&gt;
If you know the answer please advice.</description></item></channel></rss>