Order of events in TreeView & its DataSource...

2 posts, 0 answers
  1. Ken De Vries
    Ken De Vries avatar
    24 posts
    Member since:
    Mar 2010

    Posted 24 Jan Link to this post

    I am curious about the timing of events for the TreeView and the Datasource.

     I am trying to scroll a Treeview control's contents so that the expanded event is scrolled to the top.  I have gotten this to work for the most part.  You can read my solution in another thread.  However, I am seeing the TreeView's Expand event fire before the datasource RequestStart and RequestEnd events.

    This order does not seem to make sense.  My scrolling of the treeview's selected node malfunctions periodically because the expand event fires first, before the datasource returns the data for the expanded node.  This results in the scrolling not happening at all sometimes if returning the data takes a while.

    Is this design intentional?  If so, is there a way around it?  If Javascript were multi-threaded, I could easily get around this but I cannot seem to come up with a way to get around this problem.

    I would like to delay the Expand event until after the datasource RequestEnd event.

    Possible?

  2. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 26 Jan Link to this post

    Hello Ken,

    I am afraid that this behavior is by design. The internal logic behind this is the fact that the DataSource's request for child items is triggered once the parent one is expanded. Otherwise, the control cannot be aware when exactly the request should be fired, unless an user interaction occurs (by expanding certain Item).

    Regards,
    Nencho
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top