Make Property dynamicaly change between ReadOnly and ReadWrite

M

moondaddy

I'm writing a winforms app in vb.net 1.1 and want to know if there's a way
to dynamically change a property in a business class from readwrite to
readonly and back again. The next thing I want to do is set the databound
control in the UI to be readonly or disabled when the property its bound to
is readonly. This is because when certain conditions are present such as a
value in a another field, I want to make this field readonly. I can think
of a number of ways to do this such as raising events in the business class
or simply processing the logic in the UI, but I was trying to think of a way
that would involve the UI as little as possible and have the business class
be responsible for most of the work.

any recommendations?

Thanks.
 
G

Guest

There isn't a way to make a property truly read-only at run-time. The most
you could do is set a flag and use applicatoin logic to prevent the property
from being set.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top