DataGridView datasource
c#, data-binding, datagridview
Solution
Use the first way if its one-way binding.
Use the second way if its two-way binding, meaning when users change DataGridView Cells the changes will be kept/persisted in the `GetListSomeObjects()` datasource.
You haven't specified if this is WPF, Winforms, Web but you can read up more on BindingSource's and One, Two & etc Way Binding:
TwoWay
Causes changes to either the source property or the target property to automatically update the other. This type of binding is appropriate for editable forms or other fully-interactive UI scenarios.
OneWay
Updates the binding target (target) property when the binding source (source) changes. This type of binding is appropriate if the control being bound is implicitly read-only. For instance, you may bind to a source such as a stock ticker. Or perhaps your target property has no control interface provided for making changes, such as a data-bound background color of a table. If there is no need to monitor the changes of the target property, using the OneWay binding mode avoids the overhead of the TwoWay binding mode.
OneTime
Updates the binding target when the application starts or when the data context changes. This type of binding is appropriate if you are using data where either a snapshot of the current state is appropriate to use or the data is truly static. This type of binding is also useful if you want to initialize your target property with some value from a source property and the data context is not known in advance. This is essentially a simpler form of OneWay binding that provides better performance in cases where the source value does not change.
OneWayToSource
Updates the source property when the target property changes. Default Uses the default Mode value of the binding target. The default value varies for each dependency property. In general, user-editable control properties, such as those of text boxes and check boxes, default to two-way bindings, whereas most other properties default to one-way bindings. A programmatic way to determine whether a dependency property binds one-way or two-way by default is to get the property metadata of the property using GetMetadata and then check the Boolean value of the BindsTwoWayByDefault property.
Problem
I have a DataGridView and a list of some objects which populated from a SQL table. There are two ways I used to bind the list to the grid. 1.Using the list directly to the datasource `grdSomeList.DataSource = GetListSomeObjects();` 2.Using through a binding source ``` _bsSomeList = new BindingSource(); _bsSomeList .DataSource = GetListSomeObjects(); grdSomeList.DataSource = _bsSomeList ; ``` What is the best practice to bind the data source? Is there are some specific reasons behind these two?