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)
]
dnz8000@gmail.com - 20 Apr 2006 14:41 GMT
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.
dnz8000@gmail.com - 20 Apr 2006 14:43 GMT
Its the collection property that should be readonly...