开发者

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 开发者_如何学Goto 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();
        }
    }


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜