Search code examples
c#.netwinforms

Does data binding work on invisible control?


This is a .net problem with winforms, not asp.net.

I have a windows form with several tabs. I set data bindings of all controls when the form is loaded. But I have noticed that the data bindings of controls on the second tab do not work. Those bindings work only when the form is loaded and when I select the second tab. This brings the suspicion to me: data bindings work only when bound controls become visible.

Anyone can tell me whether this is true or not? It is not hard to test this but I would like to know some confirmation.

Thanks


Solution

  • You are correct. A data-bound control are not updated until the control is made visible.

    The only reference I can find for this at the moment is this MSDN thread.