This is a migrated thread and some comments may be shown as answers.

Radgrid doesn't reload in RadMultiPage after changing tab index

1 Answer 252 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Diana
Top achievements
Rank 1
Diana asked on 23 Jul 2020, 10:08 PM

Hello all, 

I have a problem with the RabTab control when I change the selected tab. The dll version is 2017.3.913.

The page structure is

RadMultiPage which contains 7 Page views and has the attribute RenderSelectedPageOnly="true". Inside each page view there is a radgrid control.

The issue is when I change the tab, the grid inside the pageview doesn't display. 

Here is the code

Default.aspx

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="reloadingPanel" ClientEvents-OnRequestStart="onRequestStart">
        <AjaxSettings>            
            <telerik:AjaxSetting AjaxControlID="tabStrip1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="tabStrip1"></telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="radMP1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="radMP1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="radMP1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
    <telerik:AjaxSetting AjaxControlID="grid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grid1" LoadingPanelID="reloadingPanel" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="grid2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grid2" LoadingPanelID="reloadingPanel" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <!--more grids-->
       </AjaxSettings> 
</telerik:RadAjaxManager>

<telerik:RadTabStrip ID="tabStrip1" runat="server" MultiPageID="radMP1" onTabClick="tabStrip1_TabClick">
            <Tabs>
                <telerik:RadTab TabIndex="1" PageViewID="pv1" Text="tab 1" Selected="true"></telerik:RadTab>
                <telerik:RadTab TabIndex="2" PageViewID="pv2" Text="tab 2"></telerik:RadTab>
                <telerik:RadTab TabIndex="3" PageViewID="pv3" Text="tab 3"></telerik:RadTab>
                <telerik:RadTab TabIndex="4" PageViewID="pv4" Text="tab 4"></telerik:RadTab>
                <telerik:RadTab TabIndex="5" PageViewID="pv5" Text="tab 5"></telerik:RadTab>
                <telerik:RadTab TabIndex="6" PageViewID="pv6" Text="tab 6"></telerik:RadTab>
                <telerik:RadTab TabIndex="7" PageViewID="pv7" Text="tab 7"></telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
<telerik:RadMultiPage ID="radMP1" runat="server" RenderSelectedPageOnly="true">
                <telerik:RadPageView ID="pv1" runat="server" Selected="true">
                    <div style="padding:10px 10px 10px 10px;background-color:#dcdcdc;height:20px">
                        <div style="clear:left;float:left;width:1030px;">
                            <div style="clear:left;float:left;width:340px;">
                                <telerik:RadButton ID="btnOpenRanking" runat="server" Text="Adjust Ranking" ToolTip="Adjust Ranking" OnClick="btnOpenRanking_Click" />
                                <telerik:RadButton ID="btnSaveRanks" runat="server" Text="Save Ranking" ToolTip="Save Ranking" Visible="false" OnClick="btnSaveRanks_Click" />
                                <telerik:RadButton ID="btnCancelRanks" runat="server" Text="Cancel" ToolTip="Cancel Ranking" Visible="false" OnClick="btnCancelRanks_Click" />
                                <asp:Label ID="lblUnrankedMessage" runat="server" Text="(Num Unranked Here)" ForeColor="Red"></asp:Label>
                            </div>                           
                        </div>                        
                    </div>
                    <telerik:RadGrid ID="grid1" runat="server" AutoGenerateColumns="false" DataSourceID="" ShowGroupPanel="true" GroupingEnabled="true" 
                            AllowFilteringByColumn="true" CellSpacing="0" GridLines="None" EnableLinqExpressions="false"
                            OnInit="grid_Init" OnItemDataBound="grid_ItemDataBound" OnItemCommand="grid_ItemCommand" OnPageIndexChanged="grid_PageIndexChanged" 
OnGroupsChanging="grid_GroupsChanging" OnPageSizeChanged="grid_PageSizeChanged" OnNeedDataSource="grid_NeedDataSource"
                            AllowPaging="true" AllowCustomPaging="true" VirtualItemCount="100000" PageSize="50" AllowSorting="true" ShowFooter="true">
                        <ClientSettings AllowColumnsReorder="true" AllowDragToGroup="true" Scrolling-UseStaticHeaders="true" />
                        <MasterTableView CommandItemDisplay="Top" AllowMultiColumnSorting="true" DataKeyNames="lcs_event_ticket_id">
                            <CommandItemSettings ShowExportToExcelButton="true" ShowExportToPdfButton="false" ShowAddNewRecordButton="false" ShowRefreshButton="true" />
                            <RowIndicatorColumn Visible="true" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
                            <ExpandCollapseColumn Visible="true" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
                            <Columns>
<!--COLUMNS DEFINITION-->
                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>
                </telerik:RadPageView>
                <telerik:RadPageView ID="pv2" runat="server">
                    <div style="padding:10px 10px 10px 10px;background-color:#dcdcdc;height:20px">
                        <div style="clear:left;float:left;width:1030px;">
                            <div style="clear:left;float:left;width:340px;">
                                <telerik:RadButton ID="btnOpenRanking1" runat="server" Text="Adjust Ranking" ToolTip="Adjust Ranking" OnClick="btnOpenRankingChicago_Click" />
                                <telerik:RadButton ID="btnSaveRanks1" runat="server" Text="Save Ranking" ToolTip="Save  Ranking" CommandArgument="4" Visible="false" OnClick="btnSaveRanksRegion_Click" />
                                <telerik:RadButton ID="btnCancelRanks1" runat="server" Text="Cancel" ToolTip="Cancel Ranking" Visible="false" OnClick="btnCancelRanks_Click" />
                                <asp:Label ID="lblUnrankedMessage1" runat="server" Text="(Num Unranked Here)" ForeColor="Red"></asp:Label>
                            </div>
</div>
                    </div>
                    <telerik:RadGrid ID="grid2" runat="server" AutoGenerateColumns="false" DataSourceID="" ShowGroupPanel="true" GroupingEnabled="true"
                            AllowFilteringByColumn="true" CellSpacing="0" GridLines="None" EnableLinqExpressions="false" 
                            OnInit="grid_Init" OnItemDataBound="grid2_ItemDataBound" OnItemCommand="grid2_ItemCommand" OnPageIndexChanged="grid2_PageIndexChanged" 
OnGroupsChanging="grid2_GroupsChanging" OnPageSizeChanged="grid2_PageSizeChanged" OnNeedDataSource="grid2_NeedDataSource"
                            AllowPaging="true" AllowCustomPaging="true" VirtualItemCount="100000" PageSize="50" AllowSorting="true" ShowFooter="true">
                        <ClientSettings AllowColumnsReorder="true" AllowDragToGroup="true" Scrolling-UseStaticHeaders="true" />
                        <MasterTableView CommandItemDisplay="Top" AllowMultiColumnSorting="true" DataKeyNames="lcs_event_ticket_id">
                            <CommandItemSettings ShowExportToExcelButton="true" ShowExportToPdfButton="false" ShowAddNewRecordButton="false" ShowRefreshButton="true" />
                            <RowIndicatorColumn Visible="true" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
                            <ExpandCollapseColumn Visible="true" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
                            <Columns>
<!--COLUMNS DEFINITION-->
                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>
                </telerik:RadPageView>
<!--MORE PAGE VIEWS WITH A GRID-->
</telerik:RadMultiPage>

Default.cs

protected void tabStrip1_TabClick(object sender, RadTabStripEventArgs e)
        {
            switch (e.Tab.TabIndex)
            {
                case 1:
                    grid1.Rebind();
                    break;
                case 2:
                    grid2.Rebind();
                    break;
            }

            tabStrip1.MultiPage.SelectedPageView.ID = e.Tab.PageViewID;
            tabStrip1.MultiPage.SelectedPageView.Selected = true;
            tabStrip1.MultiPage.SelectedPageView.Visible = true;

}

Thanks in advance,

Artemisa

 

 

 

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 28 Jul 2020, 02:37 PM

Hi Diana,

I tested the provided snippet but the grids are refreshed properly at my end. For convenience, I am attaching my test page to this reply - are you facing the same issue with it? If no, can compare it to your actual one and see how they differs?

Meanwhile, you can test is setting the AutoPostback="True" functionality of the Tabstrip will make a difference:

        <telerik:RadTabStrip ID="tabStrip1" runat="server" MultiPageID="radMP1" AutoPostBack="true" OnTabClick="tabStrip1_TabClick">

Regards,
Vessy
Progress Telerik

Tags
General Discussions
Asked by
Diana
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or