General information
Category:
The Mere Mortals .NET Framework
>Hi Sam,
>
>>I have an event handler on a form that handles the validating event for a textbox on that form. From within that event handler method I need to access the entity object property that the textbox is bound to. Can somebody please help me with some code that would allow me to do that.
>>
>>Thanks in advance.
>>
>Do you have multiple business objects registered with this form? If you know what the business object is you can use this.oMyBizObj.Entity but I suspect your question is more complicated than this. Are you trying to access the entity object by interrogating the textbox somehow to find the business object associated with it?
>
>Tim
Hi Tim,
Thanks for your quick reply and congratulations on your new MVP status. You are right, my question is more complicated. I am working on a special new textbox control and when a user attempts to leave the textbox I need to look at the underlying entity property that it is bound to. I need to do this in the validating event handler before the framework puts the new changed value into the entity property. For example: A user enters the textbox and it shows "abc" in the text property before the user makes any changes and then the user changes the text to "xyz" and attempts to leave the textbox. At that point before the framework puts the "xyz" into the entity property that the textbox is bound to, I need to see that "abc" is still in the entity property. There may be multiple business objects involved with the form.
Any ideas?
Sam Tenney
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only