create dynamic properties for an object.

  • Thread starter Thread starter Keshav
  • Start date Start date
K

Keshav

Hi all


I have a Class "Sample" with following properties

PropertyA
ProeprtyB
ProeprtyC

I am binding the sample object to property grid so that i can edit the
proeprties.
Now in the above scenario i have to make ProeprtyC to be visible only if
proeprty B is set.

Pls advice me on this. It would be great help if i get code sample.

Thanks
Keshav
 
You can't really make a property visible or not visible based on context.
What you can do is to throw an InvalidOperationException, for example, if
the context is not correct. It would really up to the code using the class
to make sure the context is correct.
 
Back
Top