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

2.2k views Asked by At

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

2

There are 2 answers

0
Sajid Hussain On

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

0
user2864496 On

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