ASP.NET MVC Tabstrip

1 Answer 58 Views
TabStrip
Rajah
Top achievements
Rank 1
Rajah asked on 30 Aug 2022, 03:27 AM

Hi Everyone.

I have a tabsrip with three two tabs, each tab has grid and calling the controller to get the data.

My question is how to  show the content when user clicks the tab (On Demand). I don't want to load the while page loads.

grid:

@(Html.Kendo().Grid<KendoUIMVC5.Models.ProductViewModel>()
                                        .Name("ContentionPriorityGrid")
                                        .Columns(columns =>
                                        {
                                            columns.Bound(s => s.ProductName).Width(400);
                                            columns.Bound(s => s.UnitPrice).Width(100);
                                        })
                                        .DataSource(dataSource => dataSource
                                            .Ajax()
                                            .ServerOperation(true)
                                            .Read(read => read.Action("Bank1", "Home"))
                                            )
                                        .NoRecords()
                                        .Sortable()
                                        .Filterable()
                                      )

Thanks,

Raja. 

1 Answer, 1 is accepted

Sort by
0
Petar
Telerik team
answered on 31 Aug 2022, 06:42 AM

Hi, Raja.

The targeted functionality can be implemented using LoadContentFrom as demonstrated in this Loading content with AJAX demo. In your scenario, instead of a specific URL, you can pass the LoadContentFrom method a controller name and action like this:

@(Html.Kendo().TabStrip()
  .Name("tabstrip")
  .Items(tabstrip =>
  {
      tabstrip.Add().Text("Tab 1")
          .LoadContentFrom("Index", "Tab1");
      tabstrip.Add().Text("Tab 2")
          .LoadContentFrom("Index", "Tab2");
  })
)

More details about the functionality that you want to implement can be found on the following links:

I hope the above details will help you achieve what you need in your application.

Regards,
Petar
Progress Telerik

The Premier Dev Conference is back! 

Coming to you live from Progress360 in-person or on your own time, DevReach for all. Register Today.


Tags
TabStrip
Asked by
Rajah
Top achievements
Rank 1
Answers by
Petar
Telerik team
Share this question
or