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

ChildItemsDataBind with Load On Demand

7 Answers 26 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Logan Marshall
Top achievements
Rank 2
Logan Marshall asked on 14 Nov 2014, 07:12 PM
Hello,

Kind of a weird question but I'll try to be as descriptive as possible. :)

I have a web app that uses on demand loading.  You can drill down about 4 levels.  I've noticed that when you drill down from level 3 to 4 it fires the events  childItemsDatabind 3 times and NeedDataSource once.  What I'm trying to accomplish is unnecessary trips to the data base and if your drilling from level 3 to 4 it should only bind that level and assume the rest of the tree levels don't need rebinding.  This would allow a single trip to the data base only for the expanded node.

Any thoughts?

7 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 19 Nov 2014, 12:04 PM
Hello Logan,

The behavior you describe is expected. When a level is expanded the control needs to rebind all currently expanded levels. Because of this the queries for the parent levels are also executed.

With this said, I would recommend to upgrade to the latest version of the controls. Recently there were significant performance improvements for the RadTreeList and the control works considerably faster. Try upgrading to the latest version and see how it works for you.

Regards,
Viktor Tachev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Logan Marshall
Top achievements
Rank 2
answered on 19 Nov 2014, 01:45 PM
Hi Viktor, 

I think I already have the latest version installed.  AjaX Q3 2014.  Other than adding the new Telerik.Web.UI, skins, etc dll's to the bin directory of the application, is there anything else that needs done to make sure I'm using the latest version?
0
Viktor Tachev
Telerik team
answered on 20 Nov 2014, 01:40 PM
Hi Logan,

If you have the Q3 2014 assemblies referenced in your application, then you are using the latest version of the controls. The full version number is 2014.3.1024. Check out the properties of the referenced dll files and ensure that they are the same version.

Regards,
Viktor Tachev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Logan Marshall
Top achievements
Rank 2
answered on 03 Dec 2014, 06:09 PM
Do you think there is anyway to accomplish this with Session() variables?  Also, how do you know if the drilled down item has not yet been drilled down to?
0
Viktor Tachev
Telerik team
answered on 08 Dec 2014, 02:06 PM
Hi Logan,

By default the data for the already expanded items is requested when an item is expanded. Modifying this behavior is not supported as it uses internal logic. Moreover, overriding the default behavior could cause the control to work incorrectly.

Regards,
Viktor Tachev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Logan Marshall
Top achievements
Rank 2
answered on 08 Dec 2014, 07:10 PM
Hi Viktor,  Thank you for your help.  I've found a work around using Session() variables that are quicker than trips to the data base.  I'll outline my solution.  It uses two session variables per drill down level.  CC stands for country code.  It also tries to make the session variable unique by concatenating the page name into the session variables.

Essentially what it does, 2nd code block, if there is a value in the session variable for that level it uses that as the data source of the node.  Else when you connect to the database to return rows, you assign that data source to the child item and the session variable to maybe use later.  It also tests to see if you drilling down to the same relevant node as you did last time with the other session variable.  This solution has made drilling approx. 50% faster at every level.  Hopefully someone doing searches on the web may find it useful.  Thanks.

conn.Open()
            Dim myDa As Oracle.DataAccess.Client.OracleDataAdapter = New Oracle.DataAccess.Client.OracleDataAdapter
            myDa.SelectCommand = cmd
            Dim myDataTable As New DataTable
            Dim myDataView As New DataView
            myDa.Fill(myDataTable)
            myDataView = myDataTable.DefaultView
            conn.Close()
 
 
            Session(pageName & "LVL1") = myDataView
            e.ChildItemsDataSource = myDataView


Dim ID As String = e.ParentDataKeyValues("ID").ToString

If Not Session(pageName & "CC_LVL") Is Nothing Then
                If Session(pageName & "CC_LVL") = ID Then
                    If Not Session(pageName & "LVL1") Is Nothing Then
                        e.ChildItemsDataSource = TryCast(Session(pageName & "LVL1"), DataView)
                         
                        Exit Sub
 
                    End If
                Else : Session(pageName & "CC_LVL") = ID
                End If
            Else : Session(pageName & "CC_LVL") = ID
            End If




‚Äč
0
Viktor Tachev
Telerik team
answered on 11 Dec 2014, 01:39 PM
Hello Logan,

Thank you for sharing your solution with the community.

Regards,
Viktor Tachev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
TreeList
Asked by
Logan Marshall
Top achievements
Rank 2
Answers by
Viktor Tachev
Telerik team
Logan Marshall
Top achievements
Rank 2
Share this question
or