Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Gridview in UpdatePanel

Status
Not open for further replies.

tqeonline

MIS
Oct 5, 2009
304
US
I have two gridviews on an update panel.

When I do a rowcommand on one I want it to update itself and the other gridview.

I have it doing a Subscribe / Unsubscribe setup.

So if they click Subscribe on a line item it goes the Unsubscribe gridview. and vica versa.

However i'm having an issue with the linking. If i hit subscribe then the item drops off the list and doesn't update the unsubscribe table.

I tried putting it in the gvSubscribe_RowCommand. But it binds the Unsubscribe before it updates the Subscribe.

So basically how can I call the update of the other gridview AFTER it has updated itself.

- Matt

"If I must boast, I will boast of the things that show my weakness"

- Windows 2003 Server, 98 SE, XP
- VB.NET, VSTS 2010, ASP.NET, EXCEL VBA, ACCESS, SQL 2008
 
fixed it by putting the databinds in the rowDeleted of the opposite gridviews.

Code:
    Protected Sub gvSubscribe_RowDeleted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeletedEventArgs) Handles gvSubscribe.RowDeleted
        gvUnsubscribe.DataBind()
    End Sub

    Protected Sub gvUnsubscribe_RowDeleted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeletedEventArgs) Handles gvUnsubscribe.RowDeleted
        gvSubscribe.DataBind()
    End Sub

- Matt

"If I must boast, I will boast of the things that show my weakness"

- Windows 2003 Server, 98 SE, XP
- VB.NET, VSTS 2010, ASP.NET, EXCEL VBA, ACCESS, SQL 2008
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top