By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,561 Members | 885 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,561 IT Pros & Developers. It's quick & easy.

Make Property dynamicaly change between ReadOnly and ReadWrite

P: n/a
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.

--
mo*******@nospam.nospam
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
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.

"moondaddy" wrote:
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.

--
mo*******@nospam.nospam

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.