Hi, here's the situation:
I have an asp:FormView w/ its corresponding ObjectDataSource and a bunch of fields. One of these fields is a usercontrol which contains a RadGrid and an associated ObjectDataSource. On the backend, I'm using entity framework 4.1.
Let's say I'm display a project in the formview. This project has several clients. The RadGrid is displaying the clients associated to the project and their information.
I have a save button at the top of the page to save all the information when I am in edit mode on the formview. In addition, when the formview is in edit mode, the RadGrid is also in edit mode.
When I click on save, I call the FormView.UpdateItem method. This calls the updatemethod of the ObjectDataSource associated with the FormView, allowing me to save the data specified in the regular fields.
Now this does not allow me to save the information that is specified in the RadGrid.
I tried manually firing the Update command of the radgird, thinking it will call the UpdateMethod of the ObjectDataSource associated to it, but that didn't work.
I thought that a possible solution would be to add a Parameter of type "Object" to the Formview's ObjectDataSource, and then sending a datatable or similar in the ObjectDataSource_Updating event, but I'm not sure how efficient that is, or if it's the best solution (or if it's even possible).
So my question: Does anyone know how I can save the information in the RadGrid which is within the formview when I press the Save button?
Thank you.
I have an asp:FormView w/ its corresponding ObjectDataSource and a bunch of fields. One of these fields is a usercontrol which contains a RadGrid and an associated ObjectDataSource. On the backend, I'm using entity framework 4.1.
Let's say I'm display a project in the formview. This project has several clients. The RadGrid is displaying the clients associated to the project and their information.
I have a save button at the top of the page to save all the information when I am in edit mode on the formview. In addition, when the formview is in edit mode, the RadGrid is also in edit mode.
When I click on save, I call the FormView.UpdateItem method. This calls the updatemethod of the ObjectDataSource associated with the FormView, allowing me to save the data specified in the regular fields.
Now this does not allow me to save the information that is specified in the RadGrid.
I tried manually firing the Update command of the radgird, thinking it will call the UpdateMethod of the ObjectDataSource associated to it, but that didn't work.
I thought that a possible solution would be to add a Parameter of type "Object" to the Formview's ObjectDataSource, and then sending a datatable or similar in the ObjectDataSource_Updating event, but I'm not sure how efficient that is, or if it's the best solution (or if it's even possible).
So my question: Does anyone know how I can save the information in the RadGrid which is within the formview when I press the Save button?
Thank you.