user2864496
user2864496

Reputation: 107

Refreshing and binding data to grid view in a tab panel of tab container

In .net project i'm working on a page which contains tab container with 3 tab panels. When i Switch between these tab panels the data is not updating. In first tab panel i have a grid view whose data should be update up on doing operations in other tabs but after doing operations in other tabs and when i return back to first tab it's showing the same results as that are displayed when the page is first loaded. I'm using object data source to bind this grid view. I want to refresh or rebind the grid view of the first tab up on returning to that tab from other tabs. I created 3 different user controls which will load for each tab and those user controls contains grid views and other controls.

it is as follows:

<asp:tabcontainer>
    <asp:tabpanel1>
        user control
    </asp:tabpanel1>
    <asp:tabpanel2>
        user control
    </asp:tabpanel2>
    <asp:tabpanel3>
        user control
    </asp:tabpanel3>
</asp:tabcontainer>

Please help me to solve this problem

Upvotes: 0

Views: 2283

Answers (2)

user2864496
user2864496

Reputation: 107

I added autopostback=true to the tab container and bound data to gridview in Page_load mehtod of the corresponding tab panel user control.

Upvotes: 0

Sajid Hussain
Sajid Hussain

Reputation: 63

You need yo refresh or update the Object data source and then call rebind or Databind function of gridview on tab change event ...

Upvotes: 0

Related Questions