Custom DataSourceControl with parameter collection at design time

Discussion in 'ASP .Net Building Controls' started by MattBell, Mar 28, 2006.

  1. MattBell

    MattBell Guest

    I have a custom DataSourceControl which has a parameter collection defined as
    a property on the object. While everything works just fine I'm having
    problems with the design time implementation of the control. I'm getting an
    error: 'DocumentDataSource' could not be set on property 'SelectParameters'
    and the control won't render to the screen.

    Now everything works fine at run time and the select parameters I've defined
    operate great, but we're getting to the point where UI types will be getting
    in here and messing with stuff and need to be able to access the control
    which contains this data source.

    I've looked around and it seems that the problem is the result of not having
    the correct attributes set on the propery or the class.

    The datasource has these attributes:
    [
    DefaultProperty("SelectParameters"),
    Designer(typeof(ArgoDocumentDataSourceDesigner), typeof(IDesigner)),
    ParseChildren(false),
    PersistChildren(true)
    ]

    the ParameterCollection has these
    [
    DefaultValue(null),
    Editor(typeof(ParameterCollectionEditor), typeof(UITypeEditor)),
    MergableProperty(false),
    PersistenceMode(PersistenceMode.InnerProperty),
    Category("Data"),

    DesignerSerializationVisibility(DesignerSerializationVisibility.Content)

    ]
    MattBell, Mar 28, 2006
    #1
    1. Advertising

  2. MattBell

    Guest

    Hi MattBell,

    I can't see it from the code you posted, but I suspect your collection
    has a setter. It should only have a getter.
    , Apr 20, 2006
    #2
    1. Advertising

  3. MattBell

    Guest

    Its the collection property that should be readonly...
    , Apr 20, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rune B
    Replies:
    0
    Views:
    438
    Rune B
    Mar 2, 2006
  2. WT
    Replies:
    2
    Views:
    623
  3. benliu
    Replies:
    0
    Views:
    361
    benliu
    Aug 22, 2006
  4. Bill Sexton
    Replies:
    1
    Views:
    398
    Bill Sexton
    Jan 26, 2007
  5. Øyvind Isaksen
    Replies:
    1
    Views:
    929
    Øyvind Isaksen
    May 18, 2007
Loading...

Share This Page