Windows Develop Bookmark and Share   
 index > Windows Forms General > Enum does not show in property grid
 

Enum does not show in property grid

Hi all,
I have a class here:

public class MyClass
{
public enum test {Blah , Yamm }
public Enum TestInPropertyGrid
{
get
{
return new test();
}
}
}

when i pass an instance of MyClass to PropertyGrid, the property TestInPropertyGrid will not display.
But when I change public Enum TestInPropertyGrid to public test TestInPropertyGrid it will work correctly.
Actually i have so many enums like test and i want my property return type to remain Enum.
Any solutions for me?


caligula  Wednesday, May 16, 2007 4:28 PM
Returning a generic Enum value type is very questionable design. Check this thread for a TypeConverter sample.
nobugz  Wednesday, May 16, 2007 6:01 PM
Why don't you make a generic property?
timvw  Wednesday, May 16, 2007 5:56 PM
Returning a generic Enum value type is very questionable design. Check this thread for a TypeConverter sample.
nobugz  Wednesday, May 16, 2007 6:01 PM

You can use google to search for other answers

Custom Search

More Threads

• Custom Permission Set
• multiselection of items at a time
• Locking a form from being re-sized
• Widows-System error (a duplicate name...)
• Location of selected DataGridViewRow
• A few questions
• How to paste into code.
• Scrolling picture box containing graph
• Custom Control
• Rotating shapes and point on screen click