sebastian.
Member
- Joined
- Sep 20, 2009
- Messages
- 17
- Programming Experience
- 1-3
Hello everybody!
My application looks like the following:
1. An XML file is read using LINQ and the result is an enumeration of objects of a specific type (i don't use anonymous types). The result is then converted with result.ToList() to a standard list and saved to a list-variable.
2. I added "Datasource" -> "Object" -> my specific class as a datasource to my project.
3. Then I drag-and-dropped this one to my windows form and a DataGridView was created.
4. Then I have a BindingSource and a BindingNavigator.
5.
The datasource of my BindingSource is my list-variable from above.
The datasource of my DataGridView is my BindingSource.
The bindingsource of my BindingNavigator is my BindingSource.
When I load my application, the data of the XML file is shown in the DataGridView.
6. When I delete a row using the delete-button of the BindingNavigator toolbar, it is deleted in my list-variable from above as well (which is my datasource of my bindingsource), but not in my XML file...that's okay!
-> everything works fine so far.
7. Now I have a button which is called "update dgv" and when i click it, the XML file is queried again using LINQ and the result is again saved in my list-variable. Just before the new query results are assigned to the list-variable, it contains all the data except the deleted and after the assignment it contains all the data like in the xml file. So now the deleted DGV items are again in my list-variable -> okay.
BUT they won't show up in my DataGridView although the list-variable is still my datasource of my BindingSource.
Can anybody see a problem in my steps described above?
Do I have to assign the list-variable as the datasource of my BindingSource again, because this is the only step I did "by hand / with extra code" when I load the windows form and not using the VisualStudio interface.
Thanks in advance for your help!
Greetings from Germany, Sebastian
My application looks like the following:
1. An XML file is read using LINQ and the result is an enumeration of objects of a specific type (i don't use anonymous types). The result is then converted with result.ToList() to a standard list and saved to a list-variable.
2. I added "Datasource" -> "Object" -> my specific class as a datasource to my project.
3. Then I drag-and-dropped this one to my windows form and a DataGridView was created.
4. Then I have a BindingSource and a BindingNavigator.
5.
The datasource of my BindingSource is my list-variable from above.
The datasource of my DataGridView is my BindingSource.
The bindingsource of my BindingNavigator is my BindingSource.
When I load my application, the data of the XML file is shown in the DataGridView.
6. When I delete a row using the delete-button of the BindingNavigator toolbar, it is deleted in my list-variable from above as well (which is my datasource of my bindingsource), but not in my XML file...that's okay!
-> everything works fine so far.
7. Now I have a button which is called "update dgv" and when i click it, the XML file is queried again using LINQ and the result is again saved in my list-variable. Just before the new query results are assigned to the list-variable, it contains all the data except the deleted and after the assignment it contains all the data like in the xml file. So now the deleted DGV items are again in my list-variable -> okay.
BUT they won't show up in my DataGridView although the list-variable is still my datasource of my BindingSource.
Can anybody see a problem in my steps described above?
Do I have to assign the list-variable as the datasource of my BindingSource again, because this is the only step I did "by hand / with extra code" when I load the windows form and not using the VisualStudio interface.
Thanks in advance for your help!
Greetings from Germany, Sebastian