Say I have a DataGrid on one form, and a number of simple controls on
another form, both bound to the same DataSet. The form with the
DataGrid is launched from the control form, and the DataSet and the
name of the table are passed to the form's constructor and then
assigned to the DataGrid's DataSource and DataMember properties,
respectively.
1) What is the best strategy for keeping the two forms synchronized
(i.e. changing the focused row on the DataGrid updates the
CurrencyManager on the control form and updating the CurrencyManager
on the control form updates the focused row on the DataGrid)?
Now suppose the DataGrid is sorted by clicking on a column.
2) Is the sort applied to just the grid, or is the sort applied to the
assigned DataSource as well?
3) Once the grid is sorted, how do I keep it synchronized with the
control form?
Thanks....
--Bruce
Andrew Smith \(Infragistics\) - 26 Feb 2005 20:28 GMT
You should set the BindingContext of one form to that of the other so that
if they are using the same dataset (for the datasource) and the same
datamember, they will use the same currencymanager and will stay in sync
(including when the grid sorts the dataview).
> Say I have a DataGrid on one form, and a number of simple controls on
> another form, both bound to the same DataSet. The form with the
[quoted text clipped - 19 lines]
>
> --Bruce