在VS2010集合编辑器中编辑字符串集合
因为我所有的疑虑都在这里消失了......:)我还有另一个问题。
我有一个自定义控件,其中有一个字符串列表列表,我希望控件的用户能够在属性编辑器中编辑列表,但我不起作用。我可以单击按钮来使集合编辑器可见,但添加键未启用,并且显示一条消息“属性编辑不可用”。
我做了一个定制的快速而肮脏的课程
public class DataUrl
{
public string Url {get; set;}
public DataUrl() { }
public override string ToString()
{
return Url.ToString();
}
}
,用这个它可以工作,但它...... 我怀疑它不起作用,因为字符串(或字符串)没有无参数构造函数。我也尝试过使用该属性
[NewItemTypesAttribute(typeof(string))]
但毫无价值.. 有人可以帮助我吗?
As all my my doubts are used to vanish here... :) I have got an other question.
I have a custom control in which I have a list of strings List and I'd like the user of my control to be able to edit the list in the properties editor but I doesn't work.. I can click on the button to make the Collection editor visible but the add key is not enabled and there's a message 'Property editing is not available'.
I made a custom quick and dirty class
public class DataUrl
{
public string Url {get; set;}
public DataUrl() { }
public override string ToString()
{
return Url.ToString();
}
}
and with this it works but its...
I suspect it doesn't work because string (or String) does not have a parameter-less constructor. I also tried to use the attribute
[NewItemTypesAttribute(typeof(string))]
but worthless..
Could someone help me ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)