Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating child formview problem
Message
 
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Miscellaneous
Thread ID:
01220413
Message ID:
01220443
Views:
22
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform