That has gotta be a record! You win the prize! Cheers...
for anyone reading this thread who is as paste-happy as
me: textBoxDataServerhostname.DataBindings["Text"].BindingManagerBase.EndCurrentEdit();
So... anyone game to explain the underlying reason why this is the case?
> Try adding this line of code after setting the text throught code
>
[quoted text clipped - 23 lines]
> >
> > Thanks in advance for any help...
Rua Haszard Morris - 14 Oct 2004 05:07 GMT
Another less critical question...
All the controls on the form are bound like so:
textBoxDataServerhostname.DataBindings.Add("Text", localOptions,
"DataServerHostname");
numericUpDownPort.DataBindings.Add("Value", localOptions, "Port");
[etc]
Is there a way, (e.g.) when the form is closed, to EndCurrentEdit on all of
them? e.g. something like:
Formclass.BindingContext.EndCurrentEdit()
Should I be setting up the bindings in a different way to make an operation
like that possible?
cheeeers again,
Rua HM.
> That has gotta be a record! You win the prize! Cheers...
>
[quoted text clipped - 30 lines]
> > >
> > > Thanks in advance for any help...
Sijin Joseph - 14 Oct 2004 05:49 GMT
Well the thing is, that the data gets sent to the source only when
EndCurrentEdit() is called. Typically this gets called in the
OnValidating() event of the control when you move focus away from the
control. Try moving focus away from the control and see if the data gets
commited, you may also use reflection to call the control.OnValidating()
method to get a similar effect.
Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph
> That has gotta be a record! You win the prize! Cheers...
>
[quoted text clipped - 30 lines]
>>>
>>>Thanks in advance for any help...