Hi,
I am sorry if I am not able to explain my requirement in the Subject. What I want is, I have a class with two Properties like HasSubMenu, and SubMenu Collection, object of this class is bound to property grid. The class i sgiven below.
class Menu { private bool m_HasSubMenu; private List<Menu> m_SubMenu; [Browsable(true)] public bool HasSubMenu { get { return m_HasSubMenu; } set { m_HasSubMenu = value; } } [Browsable(true)] [ReadOnly(true)] public List<Menu> SubMenu { get { return m_SubMenu; } set { m_SubMenu = value; } } }
This object of this class (initially with HasSubMenu false and an empty SubMenu Collection) is bound to a property grid. Now that I have a ReadOnlyAttribute set for SubMenu property this collection is read only and user can't edit in the property grid. But what I want is if the user changes the HasSubMenu property to true I want this collection to be editable (I mean somehow I want to make this ReadOnly attribute of SubMenu property false.)
I am not able to figure out how should I do this. Any help will be highly appreciated
Regards,
Vinod S Nair