用于在 Visual Studio 设计器中编辑用户控件的 DataMember 的标签
我有 [AttributeProvider (typeof(IListSource))] 标签,它允许我通过 Visual Studio 编辑器中的下拉列表编辑数据源字段。是否有类似的标签可供使用,以便我可以以相同的方式编辑 DataMember 属性。现在我必须输入 DataMember 的值,如果我必须继续查找字段名称,这会花费很多时间......
[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 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();
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最终使用了[Browsable(true)]。这让我可以将该字段编辑为文本字段,但没有下拉菜单...
I ended up using [Browsable(true)]. this let me edit the field as a text field but no drop down menu...