Knowing when DataBinding is completed?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello.

I am using databindings to bind my dataset to comboboxes, textboxes and
labels. Some of my UI depends on knowing when the user changes the values,
but I have some problems knowing when my dataset value is set in the
controls.

- SelectedIndexChanged event fires during the bind process, so I can't just
use that
- The binding don't seem to "kick in" until the tab page where the control
is is focused

Is there some advice out there? Thank you in advance.

- Niklas Ringdahl
 
Niklas,

You should get the BindingManagerBase (or whatever class is derived from
that, usually a CurrencyManager) and register an event handler for the
BindingComplete event (if you want to check when binding occurs) or the
CurrentCompleted or CurrentItemChanged if you want to see when specific
items change.

Hope this helps.
 
Nicholas,

My BindingManagerBase object doesn't have the events you are talking about.
Only CurrentChanged and PositionChanged. Where can I find the ones you
mentioned?

Related question: I bind to related data in my dataset, how does the
CurrentChanged behave with that? Will it fire on all changes done to my
dataset, wherever they occur?

- Niklas


Nicholas Paldino said:
Niklas,

You should get the BindingManagerBase (or whatever class is derived from
that, usually a CurrencyManager) and register an event handler for the
BindingComplete event (if you want to check when binding occurs) or the
CurrentCompleted or CurrentItemChanged if you want to see when specific
items change.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Niklas Ringdahl said:
Hello.

I am using databindings to bind my dataset to comboboxes, textboxes and
labels. Some of my UI depends on knowing when the user changes the values,
but I have some problems knowing when my dataset value is set in the
controls.

- SelectedIndexChanged event fires during the bind process, so I can't
just
use that
- The binding don't seem to "kick in" until the tab page where the control
is is focused

Is there some advice out there? Thank you in advance.

- Niklas Ringdahl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top