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

RadDocking Tabbed Pane Content Loading

2 Answers 99 Views
Docking
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
Veteran
David asked on 11 Mar 2021, 09:17 AM

Hello

I have an application that uses RadDocking with tabbed RadPanes containing RadGridViews. It appears that the default behaviour of RadDocking is to lazy load the contents and data of a pane only when the tab is selected - so the data in my RadGridViews is only loaded when a tab is brought into view.

So, in this example the DataLoaded event for FirstGrid will fire on startup as FirstTab is the pane in view. The Dataloaded event for SecondGrid will only fire when the user selects SecondTab and brings it into view:

<telerik:RadDocking>
    <telerik:RadDocking.DocumentHost>
        <telerik:RadPaneGroup>
            <telerik:RadPane
                x:Name="FirstTab"
                Title="First">
                <telerik:RadGridView
                    x:Name="FirstGrid"
                    ItemsSource="{Binding Items}"
                    AutoGenerateColumns="True"
                    DataLoaded="FirstGrid_DataLoaded"/>
            </telerik:RadPane>
            <telerik:RadPane
                x:Name="SecondTab"
                Title="Second">
                <telerik:RadGridView
                    x:Name="SecondGrid"
                    ItemsSource="{Binding Items}"
                    AutoGenerateColumns="True"
                    DataLoaded="SecondGrid_DataLoaded"/>
            </telerik:RadPane>
        </telerik:RadPaneGroup>
    </telerik:RadDocking.DocumentHost>
</telerik:RadDocking>

 

Whilst I can see the benefit of this behaviour, my application has a requirement to ensure that all the data is loaded at startup - partly for performance purposes, but also for another reason.

Is there a way to override the default behaviour and force the contents of all the tabs to load on startup?

 

Thanks for any help

 

Dave

2 Answers, 1 is accepted

Sort by
0
Accepted
Dilyan Traykov
Telerik team
answered on 15 Mar 2021, 03:37 PM

Hello Dave,

Thank you for the provided code snippet.

I believe you can achieve the desired result by calling the OnApplyTemplate of the RadGridView controls in their Loaded event handler. This will in turn trigger the DataLoaded event.

To demonstrate this, I've prepared a small sample project which you can find attached to my reply.

Please have a look and let me know if the same approach would work at your end.

Regards,
Dilyan Traykov
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.

0
David
Top achievements
Rank 1
Veteran
answered on 15 Mar 2021, 04:41 PM
Perfect! Thanks, Dilyan.
Tags
Docking
Asked by
David
Top achievements
Rank 1
Veteran
Answers by
Dilyan Traykov
Telerik team
David
Top achievements
Rank 1
Veteran
Share this question
or