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

[Solved] Tabstrip with Grid refresh issue

1 Answer 193 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Matt
Top achievements
Rank 1
Matt asked on 09 Jan 2011, 12:57 PM
I've seen a lot of posts from people having problems with this. I've tried a number of approaches but I couldn't get the grid that is loaded in a partial view in a tabstrip to refresh correctly in the tabstrip i.e. without the whole page refresh issue when sorting or paging.

I've read this http://www.telerik.com/help/aspnet-mvc/using-with-partial-views-loaded-via-ajax.html

I want the content loaded when the tab is selected however this article requires an additional click and custom code to manually handle the ajax call. I've downloaded the GridAndTabstrip example (178059_gridandtabstrip.zip) yet that gave me an Internal Server error when the tab is selected. I upgraded that example to the latest version and got it working.

The updated example is attached for anyone else having problems.



1 Answer, 1 is accepted

Sort by
0
MrSena
Top achievements
Rank 1
answered on 15 Dec 2011, 11:55 AM
Hi!

Refresh problem is not solved if each tab contains a grid.
Try to replace the contents of Index.aspx
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
 
<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Home Page
</asp:Content>
 
<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
   
  <h2>GridAndTabStrip</h2>
   
   <% Html.Telerik().TabStrip()
            .Name("AdminTab")
            .Items(tabstrip =>
            {
                tabstrip.Add()
                    .Text("FakeData1")
                    .LoadContentFrom("GridLoadOnDemand", "Home");
                 
                tabstrip.Add()
                    .Text("FakeData2")
                    .LoadContentFrom("LoadOnDemandDocument", "Home");
                     
                tabstrip.Add()
                    .Text("Grid")
                    .LoadContentFrom("GridLoadOnDemand", "Home");
            })
            .SelectedIndex(0)
            .Render();
        %>
</asp:Content>

In first tab load the Grid also, and add .SelectedIndex(0)
We can see problem when refresh grid in third tab.

How to solve this problem?

Tags
TabStrip
Asked by
Matt
Top achievements
Rank 1
Answers by
MrSena
Top achievements
Rank 1
Share this question
or