Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Controls / February 2005

Tip: Looking for answers? Try searching our database.

Synchronizing Grid and Controls on Different Forms

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bruce - 26 Feb 2005 11:50 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.