Please tell me the advice on c # winforms vs2010. The button with form1 opens form2, in which the Datagridview is located. When you open a form2, the code loads three columns with data from the mdb file into this Datagridview. Next, the user selects the desired line (s) from Datagridview and pressing the button on form 2 adds them to the ListBox on form 1.

How can I do the following: the user opened form 2, chose (one line at a time) in Datagridview the necessary lines and created a group from this data, like a sample under his own name. And so that each user of the program when displaying form 2 displays their previously saved selections.

This is necessary so that the user each time does not select the desired rows from Datagridview to add them to the ListBox, but can identify and save its own set of rows.

  • This data must be stored in the database (in order to save the program when closing the program). For example, they added a table and recorded the user id and the number of the selected line (several records in the table with the user). Then, when booting from mdb, select them - Shpunder
  • Thank! The problem is that when you run form2, the data set in Datagridview may change (if the mdb file is changed). Therefore, I would like to upload selected lines from Datagridview to the type of program "settings"? (using, for example, the 2 buttons "create a selection" and "delete a selection"). - olga
  • so it is not important whether the file is changed or not. in Datagridview, load the entire file, just the selected data remains the same as it was (in the database, one table is your data, and the second is the selected rows from the user. - Shpunder
  • If you need to store data in the program settings, you can make an xml file and write the selected lines to it. To do this, create a class and then serialize / deserialize xml - Shpunder
  • Thank you very much! - olga

0