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

ajax bound grid inside tab strip needs tab index

1 Answer 51 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.
Alden
Top achievements
Rank 1
Alden asked on 11 Dec 2011, 07:35 AM
Hi,

I have an ajax-bound grid inside a tabstrip that is loaded with loadcontentfrom().  All of the tabs use the same grid, but each time it is bound to different items in the model.  I would like to use a single grid and pass the tab index in the ajax select method.  How do I do this?  Specifically:
Part of tab strip:
 
@{ Html.Telerik().TabStrip()
        .Name("TabStrip")
        .Items(parent => {
            parent.Add()
                .Text("My Tasks")
                .Selected(true)
                .LoadContentFrom("MyTasks", "Tasks");
...
 
And Grid inside tabstrip:
 
@(Html.Telerik().Grid(Model).Name("TaskGrid")
                .ToolBar(commands => commands.Insert())
                .DataKeys(keys => keys.Add(c => c.Id))
        .DataBinding(dataBinding => dataBinding
              .Ajax().Select("_AjaxMyTasks", "Tasks", new { tabindex = WHAT GOES HERE? })
 
And the Ajax select method in the controller:
 
        public ActionResult _AjaxMyTasks(string tabindex)
        {
...
Thanks for your help!

AldenG

1 Answer, 1 is accepted

Sort by
0
MrSena
Top achievements
Rank 1
answered on 15 Dec 2011, 02:49 PM
http://demos.telerik.com/aspnet-mvc/razor/grid/editingajax
.Ajax().Select("_AjaxMyTasks", "Tasks")
in Controller:
[GridAction]
public ActionResult _SelectAjaxEditing()
{
  return View(new GridModel(GETDATA()));
}

GetData mast be return ICollection
Tags
TabStrip
Asked by
Alden
Top achievements
Rank 1
Answers by
MrSena
Top achievements
Rank 1
Share this question
or