.net - When is it worth using a BindingSource? -


I think I understand what the binding source class does - i.e. the data source and a UI control It implements the IBindingList interface and hence also provides support for sorting. And I have used it many times, without a lot of problems but I am wondering if I want to use it as often as I would like to use it. Perhaps an example would help. Let's say I have a simple textbox on the form (using WinForms), and I would like to paste that text box into a common property within a square that gives the string. Is the binding source useful to use in this situation?

Now we say that I have a grid, and I want to pair it in DataTable. Should I now use a binding source?

In the latter case, maybe I will use a BindingSource, as a DataTable, which I can collect, the binding source will be the data itself, when a row is added to the correct events If it is removed, then the fire will fire so that the grid automatically updates.

But with the initialization of a string in the first letter, I can probably classify the string property in which INOTifyPropertyChanged is applied so that this string changes when the PropertyChanged event can fire. I will use a binding source so that he can listen to these transient events so that it can automatically change the text box by changing the string.

How is this so far? I still think that there is a difference in my understanding that I am prevented from seeing the whole picture, it has been a very unclear question so far, so I will try to ask some more specific questions - ideally the above examples or something Will refer to the same kind ...

(1) Is it usable to use a binding source in one of the above examples?

(2) It seems that developers just "believe" that DatatableBill will do the right thing in firing on the right-handed events. How does anyone know that the data source is able to do this? Is there any special interface that developers should implement a data source in order to be able to accept this behavior?

(3) Is it a matter of control, a binding resource? Or is it the only data source on which the decision should affect? Perhaps the answer is (and it seems logical enough): To understand the control should be intelligent enough, otherwise the binding resource is necessary. So how does it tell that control is capable of doing it? Then, is there a special interface that developers can see that control should be implemented?

This is the state of this confusion, which, before, me always is a binding source. But I want to understand better when use one, so that I can only do so.

itemprop = "text">

Hello, I also make some confusion about this topic.
When I use data, all these interfaces are applicable.
Still I always use bindings to make sure .. :)

There is some logic that I can think of

  1. Many on the same record View
  2. Sorting, sorting (filter / sorting) when changing the sequence of records
  3. Ability to disable binding for one, while for display reasons (when large updates in the table , Then listen to all IXXChanged events)
  4. IErrorprovider has binded resources for me Without it did not work, although it may be my fault.

Comments