I have a Windows application with a MainForm that has a menue and a DataGridView with two columns on it. The first column is read-only and contains Roles the current Windows user can have. The second column contains a CheckBox indicating whether the current Windows user actively participates in the Role or not. The user can edit this CheckBox.
The idea is to provide a tool for testers that allows them to switch roles for testing in a easy and fast manner by just check marking the roles they need. So far any thing works fine and as expected.
The MainForm provides a menue to let developers and administrators access forms, opend as dialogs, for further role managment and assignment. This is where the problem starts.
As an example I take the situation where a developer clicks on the menue to "Assign Roles to Users". In this case a Form is opened as a dialog. The Form contains a DataGridView similar to that on the MainForm but showing all users data and therefore having one more column with the Username.
Now the problem is, that if I mark/unmark the active flag for a role on the MainForm before opening the "Assign Roles to Users" form, that change is not contained in the data after opening the "Assign Roles to Users" form.
The DataGridViews on the two forms are based on the same DataSet and TableAdapter. However, they differ in the query. The difference in the queries is the WHERE clause (WHERE UserID = @CurrentUser).
The main problem I see is that the data do not get updated before the user actively switches the row. If the user switches the row before opening the other form, I can get the updates from the MainForm to the assignment form.
How can I get the updates and properly synchronize them between forms?
The following links includes screenshots.
1. MainForm after application has been started
2. Select Manager role
3. Open the form for further Role to User assignment
4. After the form has been opened, the value previousely changed in MainForm is not there
You might also take a look at my previous question releted to the same issue: