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

Load on demand many nodes with IE 8

3 Answers 51 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Santiago
Top achievements
Rank 1
Santiago asked on 09 Feb 2011, 10:03 PM
I'm loading about 2000 child nodes under a single parent. It works fine with Firefox 3.6 and with Chrome 9, but IE 8 is incredibly slow... not only loading the child nodes, but after the child nodes are loaded the whole interface slows down and turns unresponsive.

I'm using Q1 2010. Any tips to solve this performance issue with IE 8? Should I try to upgrade to Q3 2010?

Thanks,
Santiago.

3 Answers, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 15 Feb 2011, 10:07 AM
Hi Santiago,

Could you, please, post an example of how exactly do you load the nodes?
I am sure we will be able to suggest something.


Regards,
Nikolay Tsenkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Santiago
Top achievements
Rank 1
answered on 16 Feb 2011, 11:22 PM
Here is a simple code example.

Markup code:
<telerik:RadFileExplorer ID="RadFileExplorer1" runat="server" Configuration-ViewPaths="/">
</telerik:RadFileExplorer>
Code behind:
Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Me.RadFileExplorer1.Configuration.ContentProviderTypeName = GetType(FileProvider).AssemblyQualifiedName
End Sub
Custom provider:
Imports Telerik.Web.UI.Widgets
Imports Telerik.Web.UI
 
Public Class FileProvider
    Inherits FileSystemContentProvider
 
    Public Sub New(ByVal context As HttpContext, ByVal searchPatterns As String(), ByVal viewPaths As String(), _
            ByVal uploadPaths As String(), ByVal deletePaths As String(), ByVal selectedUrl As String, _
            ByVal selectedItemTag As String)
 
        MyBase.New(context, searchPatterns, viewPaths, uploadPaths, deletePaths, selectedUrl, selectedItemTag)
    End Sub
 
    Private Function GetDirectoryRoot() As Telerik.Web.UI.Widgets.DirectoryItem
        Dim dir = New Telerik.Web.UI.Widgets.DirectoryItem With {.Name = "/", .FullPath = "/", .Files = New Telerik.Web.UI.Widgets.FileItem() {}}
 
        Dim childs As New List(Of Telerik.Web.UI.Widgets.DirectoryItem)
        childs.Add(New Telerik.Web.UI.Widgets.DirectoryItem With {.Name = "1", .FullPath = "/1"})
        childs.Add(New Telerik.Web.UI.Widgets.DirectoryItem With {.Name = "2", .FullPath = "/2"})
        childs.Add(New Telerik.Web.UI.Widgets.DirectoryItem With {.Name = "3", .FullPath = "/3"})
 
        dir.Directories = childs.ToArray
        Return dir
    End Function
 
    Private Function GetDirectory1() As Telerik.Web.UI.Widgets.DirectoryItem
        Return New Telerik.Web.UI.Widgets.DirectoryItem With {.Name = "1", .FullPath = "/1", .Directories = New Telerik.Web.UI.Widgets.DirectoryItem() {}, .Files = New Telerik.Web.UI.Widgets.FileItem() {}}
    End Function
 
    Private Function GetDirectory2() As Telerik.Web.UI.Widgets.DirectoryItem
        Dim dir = New Telerik.Web.UI.Widgets.DirectoryItem With {.Name = "2", .FullPath = "/2", .Files = New Telerik.Web.UI.Widgets.FileItem() {}}
 
        Dim childs As New List(Of Telerik.Web.UI.Widgets.DirectoryItem)
        For i = 0 To 2000
            childs.Add(New Telerik.Web.UI.Widgets.DirectoryItem With {.Name = i.ToString, .FullPath = "/2/" & i})
        Next
 
        dir.Directories = childs.ToArray
        Return dir
    End Function
 
    Private Function GetDirectory3() As Telerik.Web.UI.Widgets.DirectoryItem
        Return New Telerik.Web.UI.Widgets.DirectoryItem With {.Name = "3", .FullPath = "/3", .Directories = New Telerik.Web.UI.Widgets.DirectoryItem() {}, .Files = New Telerik.Web.UI.Widgets.FileItem() {}}
    End Function
 
    Public Overrides Function ResolveRootDirectoryAsTree(ByVal path As String) As Telerik.Web.UI.Widgets.DirectoryItem
        Return ResolveDirectory(path)
    End Function
 
    Public Overrides Function ResolveDirectory(ByVal path As String) As Telerik.Web.UI.Widgets.DirectoryItem
        Select Case path
            Case "/"
                Return GetDirectoryRoot()
            Case "/1"
                Return GetDirectory1()
            Case "/2"
                Return GetDirectory2()
            Case "/3"
                Return GetDirectory3()
            Case Else
                Return New Telerik.Web.UI.Widgets.DirectoryItem With {.Name = path, .FullPath = path, .Directories = New Telerik.Web.UI.Widgets.DirectoryItem() {}, .Files = New Telerik.Web.UI.Widgets.FileItem() {}}
        End Select
    End Function
 
    Public Overrides Function GetPath(ByVal url As String) As String
        Return url
    End Function
End Class

Everything works fine with Firefox and Chrome, but with IE8 when I expand the folder "2" I get a script warning like this:

"---------------------------
Windows Internet Explorer
---------------------------
Stop running this script?

A script on this page is causing your web browser to run slowly.
If it continues to run, your computer might become
unresponsive.
---------------------------
Yes   No   
---------------------------"

And after the child nodes are loaded every action seems to have a little lag (e.g. click on the tree scroll).

P.S.: I just realized maybe this isn't the right forum for this issue. If this is the case, could you please move the thread to the FileExplorer forum?

All the best,
Santiago.
0
Dobromir
Telerik team
answered on 28 Feb 2011, 11:58 AM
Hi Santiago,

In the following help article you can find a detailed explanation of how the RadFileExplorer's content provider works:
Using custom FileBrowserContentProvider

The method ResolveRootDirectoryAsTree() is used to populate the TreeView and the folders in the Grid, and it is called for all first level children of the root folder, while the ResolveDirectory() method is used only to populate the files in the Grid. In the provided code I noticed that you are explicitly calling ResolveDirectory() in the ResolveRootDirectoryAsTree() and if the folders contain large amount of files this may slow the performance of the explorer. At this moment, it is not possible to modify this behavior of the control.

In addition, do you experience the same issue under Internet Explorer 8  using the default content provider of RadFileExplorer?

All the best,
Dobromir
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
TreeView
Asked by
Santiago
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Santiago
Top achievements
Rank 1
Dobromir
Telerik team
Share this question
or