If you used the visual designer, then the bindings are set in the
InitilizeComponent method that is called by the forms ctor. they have the
syntax of

controlname.Bindings.Add(property name, data source, data source path).

You can move these somewhere else, as long as it is after
InitilizeComponent. What you might try is using the Parse and/or Format
events on the Binding object. This will allow you to "intercept" the data
as it travels from datasource to control and back again. Wait until this
event happens for the particular control, do whatever magic needs to be
performed and then manually show the form.

BTW you generally will NOT use BindingManagerBase, but will use
CurrencyManager for list based datasource, which derives from
BindingManagerBase.

HTH

Jay


On Mon, 10 Jun 2002 11:00:52 +0100, Simon Carley
<[EMAIL PROTECTED]> wrote:

>I have a problem invoking a forced refresh of data from a data source
into a
>data bound control.  My reason for forcing a refresh is as follows:
>
>I have a set of controls (not data bound) on a WinForm which should have
>some of their properties determined at run time.  The logic used to
>determine their properties is based on a property of a control which _is_
>data bound.  I am finding that the property of the data bound control is
>only set when I show the WinForm.  Since some properties of other controls
>depend on the value of a data bound property, any of the property changes
of
>the other controls have to be made when the WinForm is visible.  This is
>undesirable.
>
>Take, for example, the size of the form is determined by logic in the
>WinForm based on a data bound property of a button.  Since the data bound
>property is only accessible after the WinForm is displayed I have to
perform
>the logic once the form is visible.  As you might have guessed, this means
>that the user will see the form resize.
>
>Summary: How can I force data to be populated into data bound controls
>_before_ the form is shown?
>
>I understand that there is a protected method BindingManagerBase.PushData.
>Can I/should I utilise this?  Is there another solution to this problem?
>
>Regards
>
>Simon
>
>You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
>subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to