Persisting a collection property in a custom datagrid

Discussion in 'ASP .Net Building Controls' started by jcteague@gmail.com, Dec 5, 2005.

  1. Guest

    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
     
    , Dec 5, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. john_teague

    persisting collection in a custom datagrid

    john_teague, Dec 6, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    403
    john_teague
    Dec 6, 2005
  2. john_teague

    persisting collection in a custom datagrid

    john_teague, Dec 6, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    341
    john_teague
    Dec 6, 2005
  3. Øyvind Isaksen
    Replies:
    1
    Views:
    1,001
    Øyvind Isaksen
    May 18, 2007
  4. Replies:
    1
    Views:
    305
    Tim Dot NoSpam
    May 19, 2006
  5. Nels P. Olsen

    Persisting custom dictionary property

    Nels P. Olsen, Aug 2, 2006, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    194
    Nels P. Olsen
    Aug 2, 2006
Loading...

Share This Page