Grid on 2nd tab of tabstrip doesnt call its Datasource.ReadMethod unless I force it

2 Answers 64 Views
Grid TabStrip
Blazor
Top achievements
Rank 1
Iron
Blazor asked on 20 Apr 2023, 09:53 PM
Have a grid on a 2nd tab of a tabstrip.  When the page loads, the first grid loads fine via an mvc controller method, but when I hit the 2nd tab, the grid isnt calling its DataSource.Read method.  What could I be missing?  Sorry if I cant provide code snippets at the moment,  but in the Dev tools window of the browser I can force the grid on the 2nd tab to load by calling it with javascript.  Its just not databinding initially - something with the tabs?

2 Answers, 1 is accepted

Sort by
0
Blazor
Top achievements
Rank 1
Iron
answered on 25 Apr 2023, 12:18 AM

I figured it out, although it wasn't real clear from the docs.  In my case, I used the Activate event and within the method I attached, looked for when this tab was selected by name, then called the grids 

something like this

function onActivate(e) {
    if($(e.item).find("> .k-link").text() == "My2ndTabName")
        var myGrid = $(""#gridId);
        myGrid.data('kendoGrid').dataSource.read();

}

0
Anton Mironov
Telerik team
answered on 25 Apr 2023, 06:53 AM

Hello Blazor,

Thank you for sharing the working approach with the community.

If further information or assistance is needed, do not hesitate to contact me and the team.

Kind Regards,
Anton Mironov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid TabStrip
Asked by
Blazor
Top achievements
Rank 1
Iron
Answers by
Blazor
Top achievements
Rank 1
Iron
Anton Mironov
Telerik team
Share this question
or