>I have a master-detail page with gridview containing the master records and a formview showing the detail of the record that the user selects in the gridview. Both controls are bound using the objectdatasource. In the formview I have a button that calls a function that does some processing including updating a field in the data that's displayed in formview. The problem is when the button is clicked and processing completed that data displayed in formview is not updating. If I navigate away from the page and then go back to it the data is updated. How do I get the formview to update the data properly?
You need to rebind the gridview's data when the formview fires the update. You may do this by attaching an ItemUpdated event to the formview. You may also need to do the same thing if you are allowing inserts and/or deletes from the formview as well. Those events are ItemInserted and ItemDeleted.
ie:
protected void MyFormView_ItemUpdated(object sender, FormViewUpdatedEventArgs e)
{
MyGridView.DataBind();
}
Michael McLain