Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 24, 2012 02:27 AM by 2pac
Apr 23, 2012 09:35 PM|LINK
I have an UpdatePanel (named "UpdatePanel1") that contains a Formview. The Formview contains several cascading webdropdown controls and an update button. The update button calls a method that references fields/controls in the Formview.
Outside of the UpdatePanel, I have a Gridview and other buttons that allow the user to delete rows, check all rows, uncheck all rows, etc. in the Gridview. The good thing about the UpdatePanel is that it only does a partial page refresh when
the user picks values from the webdropdown controls. This is desired behavior. After the update button is clicked the logic properly updates the records in the database, the processed records are deleted from the cached table (which is used as the datasource
for the Gridview), and the Gridview is rebound, but the problem is that the page is not getting reloaded/refreshed to display the updated Gridview! I think that I possibly have a markup issue, but I don't know what approach I need to take to accomplish both
tasks: 1.) prevent a full page refresh each time a user selects a value from the webdropdown in the Formview, and 2.) perform a page refresh so that the Gridview object displays the proper results - showing rows that represent the newly bound data source
(i.e., minus the rows that were updated).
This is the markup on my page:
[my formview columns are here]...
[rest of gridview markup here, listing columns, etc.]
Apr 24, 2012 02:27 AM|LINK
hi try like this, place the gridview in another UpdatePanel and in FormView1_ItemUpdated event data bind the GridView and Update the UpdatePanel2 as show in code below
<asp:Panel ID="Panel1" runat="server" Width="95%" Height="200px" ScrollBars="Vertical">
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<asp:GridView [rest of gridview markup here, listing columns, etc.]
protected void FormView1_ItemUpdated(object sender, FormViewUpdatedEventArgs e)
Note: To update the UpdatePanel programtically you need to set UpdateMode="Conditional" for an UpdatePanel