views:

35

answers:

1

I am using a Queue for a property, and it shows it as a collection in the propertygrid. The only issue, is I can't edit anything inside of it, it shows them as just "Objects" and everything is read only. I know Vector2 works fine in a propertygrid because I have a few of those by themselves. I've been googling, and found something about making a ContainerEditor, but not sure how to make one for a Queue, since it isn't a custom class.

Am I reading this right, or searching for the wrong things?

+1  A: 

You need to write TypeConverter and UITypeEditor for converting and editing Queue object. See this and this article for how to go about it. Both articles are bit dated but should be relevant - if there is something simpler has been come with later version of .NET then I am aware of it (you can try googling).

Now, for above to work, you need to decorate the class/type with attributes which is not possible if you use Queue. I will suggest that you inherit a dummy/wrapper class from Queue and apply attributes it. You can even choose specific T in your wrapper class if it make sense (e.g. class MyQueue : Queue<string> { }). Change your property type to use your wrapper class.

VinayC