Multiple Collection Properties in a Custom Control

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default Multiple Collection Properties in a Custom Control

    I am attempting to create control with 2 collection properties
    that are persisted with mode PersistenceMode.InnerProperty.

    When I create the control I get an error message '' could not be set.
    I can create and use the custom control if it contains only 1 collection
    property (commenting out the other).

    Has anyone experienced this? Is there a workaround?

    Thanks,
    John


    John Guest

  2. Similar Questions and Discussions

    1. Collection Property in web custom control
      Hi all, I'm building a custom control. I would like that on the control you can set some 'rights' For that I have an enum: public enum...
    2. server control collection with several types of properties
      Is it possible to implement a server control that will look like this: <just:control> <columns> <columnTypeA id=1></columnTypeA> <columnTypeA...
    3. Making Custom Control Properties Visible in Visual Studio's Properties Palette
      I am learning how to use the System.ComponentModel class in VB.NET so that I can add my ASP.NET controls to Visual Studio .NET 2003. I have managed...
    4. Server Control Collection Properties Solutions,Problems MVP Advice Requested
      I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the problems that I have encountered...
    5. Custom Control nad Collection property
      I have a collection-property on my control. I Add the items through a collection editor, and items tags appears. <bugge:Control>...
  3. #2

    Default Re: Multiple Collection Properties in a Custom Control

    >Has anyone experienced this? Is there a workaround?
    That error can occur if the collection property has a getter and a
    setter. For example, this is the wrong way:

    [PersistenceMode(PersistenceMode.InnerProperty),

    DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)]
    public MyCollectionType MyCollection {
    get { return _myCollection; }
    set { _myCollection = value; }
    }

    The right way:

    [PersistenceMode(PersistenceMode.InnerProperty),

    DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)]
    public MyCollectionType MyCollection {
    get { return _myCollection; }
    }


    --
    Sean Winstead
    [url]http://www.componentscience.net[/url]
    Sean Winstead Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139