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

[Solved] Few Grids inside TabStrip

0 Answers 34 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Diana
Top achievements
Rank 1
Diana asked on 01 Aug 2011, 12:06 PM
Hi,
I have a problem with binding data using client side, when I put more than one grids into tabStrip. For me, client side binding works only for first grid. For the rest of grids, after click sort or refresh options, only grid  without any styles appears on screen (basic action is fired - Favourite, instead of function _AjaxGetSetsToFavourite).

TabStrip:
 <% Html.Telerik().TabStrip()
            .Name("BrowsersTabStrip")
            .Items(tabstrip =>
            {
              tabstrip.Add()
                  .Text(Resources.SetControllerTitles.PersonalTitle)
                  .Content(() =>
                  {%>
                        <% Html.RenderAction("Personal"); %>
                    <%});
                tabstrip.Add()
                    .Text(Resources.SetControllerTitles.FavouriteTitle)
                    .Content(() =>
                    {%>
                        <% Html.RenderAction("Favourite"); %>
                    <%});
                  tabstrip.Add()
                    .Text(Resources.SetControllerTitles.BrowseTitle)
                    .Content(() =>
                    {%>
                      <% Html.RenderAction("Browse"); %>
                    <%});
            })
            .SelectedIndex(0)
            .Render();
    %>

Controller's actions(example) (SetController):
public static readonly LoadDataFunctionToFavourite = "_AjaxGetSetsToFavourite";
 public ActionResult Favourite()
        {
            var viewModel = CreateFavouriteViewModel();
            ViewData[LoadDataFunctionViewData] = LoadDataFunctionToFavourite;
            return PartialView("ListUserControl", viewModel);
        }
        [GridAction]
        public ActionResult _AjaxGetSetsToFavourite()
        {
            var viewModel =CreateFavouriteViewModel();
            ViewData[LoadDataFunctionViewData] = LoadDataFunctionToBrowse;
            return View(new GridModel(viewModel));
        }

ListUserControl (control which is used three times - for displaying every grid) (I pass Ajax function name through ViewData parameter) :
<% Html.Telerik().Grid(Model)
       .DataBinding(dataBinding => dataBinding.Ajax()
            .Select(ViewData[LoadDataFunctionViewData].ToString(), "Set")
        ) ...

Do you have any suggestions what I make in wrong way and how to repair client side binding for the rest of grids ?
Tags
Grid
Asked by
Diana
Top achievements
Rank 1
Share this question
or