ChildItemsDataBind with Load On Demand

8 posts, 0 answers
  1. Logan
    Logan avatar
    23 posts
    Member since:
    Jan 2012

    Posted 14 Nov 2014 Link to this post

    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?
  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 19 Nov 2014 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Logan
    Logan avatar
    23 posts
    Member since:
    Jan 2012

    Posted 19 Nov 2014 in reply to Viktor Tachev Link to this post

    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?
  5. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 20 Nov 2014 Link to this post

    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.

     
  6. Logan
    Logan avatar
    23 posts
    Member since:
    Jan 2012

    Posted 03 Dec 2014 Link to this post

    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?
  7. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 08 Dec 2014 Link to this post

    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.

     
  8. Logan
    Logan avatar
    23 posts
    Member since:
    Jan 2012

    Posted 08 Dec 2014 in reply to Viktor Tachev Link to this post

    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




  9. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 11 Dec 2014 Link to this post

    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.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017