This question is locked. New answers and comments are not allowed.
Hi,
I see now that when using selectedIndex, that this only takes affect when redisplaying the tab.
I have a tab that successfully displays a grid in the appropriate tab area. I have a "Create" option on the grid that successfully redisplays the tab area with the Create Form.
My issue is that in the grid, i have a standard Edit link column. But when I select this, the Edit Form is returned as a full page instead of comming up within the tab area like my Create Form ?
Here is some of the code for the successful Create .....
This is the tab page .....
This is the Gird ...
This is the action inside the controller that returns the Create page correctly ....
This is the action inside the controller that incorrectly returns the Edit page as a full page ....
Any advice on how to have the Edit page appear inside the tab area instead as a full page ?
As alwats, thanks for your time.
I see now that when using selectedIndex, that this only takes affect when redisplaying the tab.
I have a tab that successfully displays a grid in the appropriate tab area. I have a "Create" option on the grid that successfully redisplays the tab area with the Create Form.
My issue is that in the grid, i have a standard Edit link column. But when I select this, the Edit Form is returned as a full page instead of comming up within the tab area like my Create Form ?
Here is some of the code for the successful Create .....
This is the tab page .....
| <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Work.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>Analytics Work Page</h2> |
| <% Html.Telerik().TabStrip() |
| .Name("BCAMainTab") |
| .Items(tabstrip => |
| { |
| tabstrip.Add() |
| .Text("Analytic Data") |
| /* this tab will be opened initially - no need to get it with ajax */ |
| .Content(() => |
| {%> |
| <p> |
| Select the data you need to maintain or need to check. |
| </p> |
| <%}); |
| tabstrip.Add() |
| .Text("Goals") |
| .LoadContentFrom("LoadOnDemandDocument", "Work"); |
| tabstrip.Add() |
| .Text("Issues") |
| .LoadContentFrom("LoadOnDemandDocument", "Work"); |
| tabstrip.Add() |
| .Text("CompanyWork") |
| .LoadContentFrom("CompanyGrid", "Work"); |
| //.Selected(true); |
| tabstrip.Add() |
| .Text("CompanyNix") |
| .LoadContentFrom("CompanyNix", "Company"); |
| tabstrip.Add() |
| .Text("Company") |
| .HtmlAttributes(new { style="background-color:blue;color:white;" }) |
| .LoadContentFrom("CompanyGrid", "Company"); |
| tabstrip.Add() |
| .Text("Enter Company") |
| .HtmlAttributes(new { style = "background-color:blue;color:white;" }) |
| .LoadContentFrom("CompanyCreate", "Company") |
| .Visible((bool)TempData["EntryVisible"]); |
| tabstrip.Add() |
| .Text("Edit Company") |
| .HtmlAttributes(new { style = "background-color:blue;color:white;" }) |
| .LoadContentFrom("CompanyEdit", "Company") |
| .Visible((bool)TempData["EditVisible"]); |
| tabstrip.Add() |
| .Text("CompanyTabs") |
| .LoadContentFrom("CompanyTabs", "Company"); |
| }) |
| .SelectedIndex(Convert.ToInt32(TempData["workIndex"])) |
| .Render(); |
| %> |
| </asp:Content> |
This is the Gird ...
| <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<BCAnalytics.Models.CompanyVM>>" %> |
| <p><%= Html.ActionLink("Close", "Index", "Work", new { workindex = 0 },null)%></p> |
| <%= Html.Telerik().Grid(Model) |
| .Name("CompanyGrid") |
| .Columns(columns => |
| { |
| // columns.Add(o => o.cMemberNo).Width(30) ; |
| // columns.Add(o => o.cCompanyNo).Width(30); |
| columns.Add(o => o.cCompanyName).Width(200).Title("Company"); |
| columns.Add(o => o.cEmail).Title("GroupCode"); |
| columns.Add(o => o.cGroupCode).Width(120).Title("Email"); |
| columns.Add(o => o.cDateUpdated).Format("{0:MM/dd/yyyy}").Width(85).Title("Updated"); |
| columns.Add(o => o.cCompanyNo).Format(Html.ActionLink("Edit", "CompanyEdit", new { Id = "{0}" }, null).ToString()).Encoded(false).Title("").Width(32); |
| columns.Add(o => o.cCompanyNo).Format(Html.ActionLink("Delete", "CompanyDelete", new { Id = "{0}" }, null).ToString()).Encoded(false).Title("").Width(50); |
| }) |
| .Ajax(settings => settings.Action("_AjaxBindingCompany", "Company")) |
| .Pageable() |
| .Sortable(sort => sort.SortMode(GridSortMode.MultipleColumn)) |
| .Scrollable(scrolling => scrolling.Height(200)) |
| .Filterable() %> |
| <p><%= Html.ActionLink("Create New Company", "Index", "Work", new { workindex = 6 },null)%></p> |
This is the action inside the controller that returns the Create page correctly ....
| public ActionResult CompanyCreate() |
| { |
| return View( ); |
| } |
This is the action inside the controller that incorrectly returns the Edit page as a full page ....
| public ActionResult CompanyEdit(int id) |
| { |
| // return View(repository.Get(id)); |
| BCAEntities _dataModel = new BCAEntities(); |
| var CompanyToEdit = (from m in _dataModel.Company |
| where m.coCompanyNo == id |
| select m).First(); |
| return View(CompanyToEdit); |
| } |
Any advice on how to have the Edit page appear inside the tab area instead as a full page ?
As alwats, thanks for your time.