Search code examples
c#visual-studio-2008datasourcedatamember

Tag to edit DataMember of user control in visual studio designer


I have the [AttributeProvider (typeof(IListSource))] tag which lets me edit the DataSource field via dropdown list in the visual studio editor. Is there a similar tag to use so i can edit the DataMember property the same way. Right now i have to type in the value for DataMember which take a lot of time if i have to keep looking up the field names...

    [AttributeProvider(typeof(IListSource))]
    public object DataSource
    {
        get
        {
            return this.dataSource;
        }

        set
        {
            this.dataSource = value;
            BindTextBox();
        }
    }

    [Editor("System.Windows.Forms.Design.DataMemberFieldEditor", typeof(System.Drawing.Design.UITypeEditor))]
    public String DataMember
    {
        get
        {
            return this.dataMember;
        }

        set
        {
            this.dataMember = value;
            BindTextBox();
        }
    }

Solution

  • I ended up using [Browsable(true)]. this let me edit the field as a text field but no drop down menu...