Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Extending a native property
Message
From
16/12/2003 14:59:55
 
 
To
16/12/2003 12:53:37
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00859555
Message ID:
00859617
Views:
13
Thanks, Bonnie - actually I *was* trying to override a base property, so your first post told me that using the "override" keyword is all that I needed, but it's good to know that the "virtual" keyword will allow me to do the same thing with my own properties.

For some reason, I was associating the "override" kewyord strictly with methods, and hadn't thought of applying it to properties (duh!).

However, the property I was trying to work with is the Visible property, and it appears that it wasn't defined Virtual in the control base class, so it looks like establishing a handler for the VisibleChanged event is my only option in this case. Nothing wrong with this, just exploring different ways of skinning the cat...

Triggering some code on the change of the visible property as allowed an important enhancement of my golliwog TextBox control. I discovered that the Text property doesn't assume the value of the DataSource until the control becomes visible. Hence if the control is on a page in a tab control my FlushValue() method was determining that the value of the Text property did not match that of the DataSource, and was writing an empty value to the DataSource - not optimal <s>. The VisibleChanged handler is setting a private field to indicate that the flushing should occur.

I also got it working with DataTables, DataViews and object properties as DataSources!
>>-Steve->>

Steve Sawyer
Geeks and Gurus, Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform