Preventing users from adding items in ArrayEditor

Discussion in 'ASP .Net Web Controls' started by brik, Oct 25, 2004.

  1. brik

    brik Guest

    I've been trying to implement a way to edit a property (containing an
    Array of private objects) on a webcontrol at design-time ... my first
    shot actually works quite fine; the editor shows the two objects and
    i'm able to edit their content.
    BUT ... I don't want the user to be able to add/delete objects in the
    editor. Is there no way to prohibit this ?

    My code :
    public class myClass : Object
    {
    private int no;
    public int Number { get{ return no; } set{ number = value; } }
    public myClass(int aNumber) { no = aNumber; }
    public override string ToString() { return no.ToString(); }
    }

    [...]
    private myClass[] myarray = new myClass [] {new myClass (1), new
    myClass (2)};

    [Category("Appearance"),
    PersistenceMode(PersistenceMode.Default),
    EditorAttribute(typeof(System.ComponentModel.Design.ArrayEditor),
    typeof(System.Drawing.Design.UITypeEditor)) ]
    public myClass[] TestArray
    {
    get { return myarray; }
    set { myarray = value; )
    }
    [...]
     
    brik, Oct 25, 2004
    #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. Charlie
    Replies:
    1
    Views:
    332
    Kevin Spencer
    Oct 27, 2004
  2. Ned White
    Replies:
    11
    Views:
    774
    Jerry C
    May 21, 2008
  3. Peter Ehli

    System.ComponentModel.Design.ArrayEditor - How to

    Peter Ehli, Aug 19, 2004, in forum: ASP .Net Building Controls
    Replies:
    4
    Views:
    246
    Peter Ehli
    Aug 20, 2004
  4. brik

    Preventing users from adding items in ArrayEditor

    brik, Oct 25, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    140
  5. arkgroup

    List Box : help preventing duplicate items

    arkgroup, Nov 13, 2006, in forum: ASP .Net Web Controls
    Replies:
    5
    Views:
    333
    MikeS
    Nov 14, 2006
Loading...

Share This Page