Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfp .net event equivalent
Message
From
21/11/2010 10:49:30
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Vista
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01489449
Message ID:
01490018
Views:
31
> btw when I issue these statements? the parse event is fired, you would expect the reverse no? I'm probably missing something major here.

To be honest, I've not used BindingSource much. If you read my blog post, you'll see that I've always bound directly to the DataTable rather than use a BindingSource as an intermediary. I have nothing against the BindingSource, I just wrote all my classes before BindingSource was introduced to .NET. They worked fine, so why change them? <g>

However, I suppose I should double-check whether using a BindingSource changes where/when/if certain events fire. I'll get back to you later...

~~Bonnie



>>>In a "if you can't beat it, join it" spirit, I updated the bindingsource just before the (ta).update at the form level.
>>
>>Hmmm ... not sure what you mean, but did this fix your problem? (And don't get me started on the topic of using TableAdapters on Forms. That is just wrong, IMHO!)
>
>Well it did fix the ad hoc problem, but I was hoping the handle this in the baseclass whereas now I have to worry about it at the form level and the code ain't pretty :) :
>
>        Me.BindingSource1(0)("Art_Snijden") = IIf(Me.ARt_SnijdenCtl.Text = "Ja", True, False)
>        Me.BindingSource1(0)("Art_Korting") = IIf(Me.Art_KortingCtl.Text = "Ja", True, False)
>        Me.BindingSource1(0)("Art_Uitzonderlijk") = IIf(Me.art_Uitzonderlijkctl.Text = "Ja", True, False)
>        Me.BindingSource1(0)("Art_VerwittigenGewicht") = IIf(Me.Art_VerwittigenGewichtCtl.Text = "Ja", True, False)
>        Me.BindingSource1(0)("Art_Perpersoon") = IIf(Me.Art_PerpersoonCtl.Text = "Ja", True, False)
>
> btw when I issue these statements? the parse event is fired, you would expect the reverse no? I'm probably missing something major here.
>
>>
>>>I must have misunderstood what that parse event was. I thought that if format fires when the underlying data gets communicated to the control, that parse would do the reverse....
>>
>>And it does do that, you did not misunderstand. But, my point is that it does not happen until the control's Validated event fires, which will not happen if the control never loses focus ... unless you force it to happen.
>>
>>>Anyway, looking forward to your posting :).
>>
>>I'm in the process of writing it as we speak (hope I finish it before dinner-time, or it may have to wait until tomorrow).
>>
>>~~Bonnie
>>
>>>
>>>
>>>>>... the binding.parse event does not seem to fire. I was hoping that when bindingsource would .endedit, the parse event would trigger, but it does not, in fact, curiously enough I get the feeling that the format event is triggered instead and the original value of the field is saved.
>>>>
>>>>More likely what is happening is that you're clicking on a MenuItem or ToolBar button ...these controls do not cause the ActiveControl to lose focus, thus not forcing the control's value into it's databound object, which is when the Parse event fires. You need something that will force this for every control you have (it's the Validated event that accomplishes this). It can get complicated.
>>>>
>>>>I have a method that I have named ForceBind() in most of my controls (those that have it implement an Interface I have created for this type of behavior). If the control is a container object that implements that Interface (such as a Panel, UserControl, etc.) it will call the ForceBind() method of *it's* ActiveControl (if *that* control implements the Interface).
>>>>
>>>>Hmmm ... maybe I should put all this, along with some code, in a blog post. I need to post something to my blog this month, so maybe this will be it. I'm not sure if this is your problem, Marc, but it certainly could be. Let me write something up for my blog and I'll post the link here once it's done.
>>>>
>>>>~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform