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

Using a tabstrip with datasource help

1 Answer 178 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Dan asked on 16 Jan 2018, 04:44 PM

I am pulling in a tabstrip to show details within a template on the kendo grid.  I do my initial pull for the grid, but would like to use a separate datasource for the tabstrip.  I only have one tab that holds all these detail.  Is there a better way of achieving this?  I do want to show everythign in teh table like the HTML shows, but want to pull it from its own datasource when the detail table is displayed.

I do it elsewhere successfully but thats with using a grid within the template.

Below is the grid code and the template code

                  .Columns(columns =>
                      columns.Bound(i => i.DarwinInvoiceNumber).Title("Invoice").ClientTemplate("<a href='" + Url.Action("Current", "PayrollInvoices", new { i = "#: DarwinInvoiceNumber#" }) + "' >#: DarwinInvoiceNumber#</a>").Width(100);
                      columns.Bound(i => i.DivisionID);
                      //columns.Bound(i => i.Date).Format("{0:MM/dd/yyyy}");
                      //columns.Bound(i => i.CheckDate).Format("{0:MM/dd/yyyy}");
                      columns.Bound(i => i.DateDisplay).Title("Date"); //09/26/2017 DS TFS # 2798
                      columns.Bound(i => i.CheckDateDisplay).Title("Check Date"); //09/26/2017 DS TFS # 2798
                      columns.Bound(i => i.Total).Format("{0:C}");
                      columns.Bound(i => i.Employees);
                      columns.Bound(i => i.Employees).Title("Checks").Width(100);
                      columns.Bound(i => i.TotalGross).Title("Gross Wages").Format("{0:C}");
        // .Selectable()
                  .ToolBar(tools => tools.Excel())
                  .Excel(excel => excel
                  .HtmlAttributes(new { style = "height:600px;" })
                  .Reorderable(reorder => reorder.Columns(true))
                  .Resizable(resize => resize.Columns(true))
                  .DataSource(dataSource => dataSource
                      .Read(read => read.Action("Get_InvoicesRead", "PayrollInvoices"))
                  .Excel(excel => excel
        //.ProxyURL(Url.Action("Excel_Export_Summaries_Save", "Reports"))
                  .Events(events => events.DataBound("dataBound"))


<script id="template" type="text/kendo-tmpl">
                .Animation(animation => animation.Open(open => open.Fade(FadeDirection.In)))
                .Items(items =>
                        "<div class='invoice_details sub-table-background'>" +
                       "<table class='table table-bordered'><tr><td><label>Pay Period Begin:</label></td><td>#=kendo.toString(StartDate,'MM/dd/yyyy')#</td><td><label>FICA Med</label></td><td>#= kendo.toString(TotalFicaM,'c') #</td><td><label>Total Benefits</label></td><td>#= kendo.toString(TotalBenefits,'c') #</td></tr>" +
                       "<tr><td><label>Pay Period End:</label></td><td>#= kendo.toString(EndDate,'MM/dd/yyyy') #</td><td><label>FICA SS</label></td><td>#= kendo.toString(TotalFicaSS,'c') #</td><td><label>Credits</label></td><td>#= kendo.toString(TotalCredits,'c') #</td></tr>" +
                       "<tr><td><label>Net Wages:</label></td><td>#= kendo.toString(NetWagesPayRun,'c')#</td><td><label>FUTA</label></td><td>#= kendo.toString(TotalFUTA,'c') #</td><td><label>Fees </label></td><td>#= kendo.toString(TotalFees,'c') #</td></tr>" +
                       "<tr><td><label>Sales Tax:</label></td><td>#= kendo.toString(Tax,'c')#</td><td><label>SUTA</label></td><td>#= kendo.toString(TotalSUTA,'c') #</td><td><label>Amount Due</label></td><td>#= kendo.toString(AmountRemaining,'c') #</td></tr>" +
                       "<tr><td><label>Non Gross:</label></td><td>#= kendo.toString(TotalNonGross,'c') #</td><td><label>Worker's Comp</label></td><td>#= kendo.toString(TotalWC,'c') #</td><td></td><td></td></tr>" +

1 Answer, 1 is accepted

Sort by
Alex Hajigeorgieva
Telerik team
answered on 18 Jan 2018, 04:08 PM
Hello, Dan,

To bind the Kendo UI Tabstrip in an ASP.NET MVC application as part of the detail template, use the model binding approach as shown in the documentation at:

Should you face any difficulties, let me know what they are and I will get back to you with a suggestion for your specific scenario.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Asked by
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Share this question