Custom DataSourceControl with parameter collection at design time

M

MattBell

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)

]
 
D

dnz8000

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top