design time control deserialization problem

G

Guest

Hello ,
I have very mystic problem :
I have control, derrived from DataSourceControl,
I have property SelectExpression
[Editor(typeof(BSSelectExpressionsEditor), typeof(UITypeEditor))]

[DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
PersistenceMode(PersistenceMode.InnerProperty)]
public SelectExpression SelectExpression
{
get {
if (selectExpression == null)
{
selectExpression = new SelectExpression();
//more code
}
return selectExpression;

}
}

SelectExpression has property SelectParameters

[

DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
PersistenceMode(PersistenceMode.InnerProperty),
RefreshProperties(RefreshProperties.All)]
public SelectParameterCollection SelectParameters
{
get
{
if (this.selectParameters == null)
{
this.selectParameters = new SelectParameterCollection();
}
return this.selectParameters;
}
}
final generated code in aspx page after using custom UITypeEditor looks
something like this :


<xxx:UserDataSource ID="ds" runat="server">
<SelectExpression Name="Result Expression" Operation="And">
<SelectParameters>
<col:SelectParameter DataType="System.String"
FieldValue="" Name="p1" Operation="Equals">
</col:SelectParameter>
<col:SelectParameter DataType="System.String"
FieldValue="" Name="p2" Operation="Equals">
</col:SelectParameter>
</SelectParameters>
</SelectExpression>
</xxx:UserDataSource>

When i switch to source from design view and back i get error on the
control :

Error Creating Control - ds

X.Collections.SelectParameterCollection must have items of type
'X.Collections.SelectParameter'. 'col:SelectParameter' is of type
'X.Collections.SelectParameter'.

What`s wrong ?
Thanks in advance for any help.

BTW i`m using BETA 2, maybe this is a bug?

Andre
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top