I am developing a composite & user control that contains a class and a struct
in a collection.
when i try to put values in them i get an error in design mode but the
control works fine when I execute the project.
How can i fix this? I think it has to do with the attributes but i'm not
sure.
here is the code of the control:
---------------------
1 [DefaultProperty("ColumnName")]
2 [ToolboxData("<{0}:PanelForm runat=server></{0}:PanelForm>")]
3 public class PanelForm : Panel,PoentaListBasic
4 {
5 List _executeParam;
6 public List ExecuteParam
7 {
8 get
9 {
10 if (this._executeParam == null)
11 {
12 _executeParam = new List();
13 _executeParam.Add(new
ControlParam(this.SqlParameterName, this.SqlParamType, this.SqlParamSize,
this.ColumnValue, ParameterDirection.Input));
14 }
15
16
17 return _executeParam;
18 }
19 set
20 {
21 if (_executeParam == null)
22 _executeParam = new List();
23 _executeParam.AddRange(value);
24 }
25 }
26 }
1 public struct ControlParam
2 {
3 public ControlParam(string paramName)
4 {
5 this.paramName = paramName;
6
7 }
8
9 string paramName;
10 public string ParamName
11 {
12 get
13 {
14 return paramName;
15 }
16 set
17 {
18 paramName = value;
19 }
20 }
21 }
the error in the design says:
Error Creating Control - fieldPnl
Cannot create an object of type
'System.Collections.Generic.List'1[[ControlParam, Dal, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null]]' from its string representation
'(Collection)' for the 'ExecuteParam' property.
---------------------
and this is what i see on the page containing the control:
---------------------
po:PanelForm runat="server" ID="fieldPnl" ExecuteParam="(Collection)"
---------------------
Please advise...