Hi,
I have a class with two Properties like HasSubMenu, and SubMenu , object of this class is bound to property grid. The class is given below.
This object of this class (initially with HasSubMenu false and an empty SubMenu string ) is bound to a property grid. Now that I have a ReadOnlyAttribu te set for SubMenu property this string 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 string 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
Thanks and Regrads
I have a class with two Properties like HasSubMenu, and SubMenu , object of this class is bound to property grid. The class is given below.
Code:
class test
{
private bool m_HasSubMenu;
private string 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; }
}
}
I am not able to figure out how should I do this. Any help will be highly appreciated
Thanks and Regrads
Comment