Persisting a collection property in a custom datagrid

J

jcteague

I have a custom control that inherits from a DataGrid control. I have
a property that has an arraylist of strings. I want to add items as a
child tag of the grid. How is the best way to do this. Here is what I
have as of now.

[ToolboxData("<{0}:OrdersDataGrid runat=server></{0}:OrdersDataGrid>"),
ParseChildren(true)]
public class OrdersDataGrid : System.Web.UI.WebControls.DataGrid
{
...
private ArrayList dataMethodParameter = null;
[Category("Data"),
Editor("System.Windows.Forms.Design.StringCollectionEditor,
System.Design", "System.Drawing.Design.UITypeEditor, System.Drawing"),

DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
PersistenceMode(PersistenceMode.InnerProperty),
Description("Parameter to Pass to the selected OrdersProvider
Method")]
public ArrayList DataMethodParameter
{
get{return this.dataMethodParameter;}
set{this.dataMethodParameter = value;}
}
...
}

What I would like to happen is when items are added via the
StringCollectionEditor they are child items of the control
<cc1:OrdersDataGrid ... >
<DataMethodParameters>
<param>xxx</param>
<param>xxx</param>
...
</DataMethodParamters>

Thanks,
John Teague
 

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,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top