Navigate to bookmark

4 posts, 0 answers
  1. Dan Normington
    Dan Normington avatar
    6 posts
    Member since:
    Jun 2009

    Posted 29 Jun 2009 Link to this post

    There are times that I need to have the html placeholder control scroll to a bookmark within my content. This seems to work just fine in Internet explorer, but doesn't in Firefox and Chrome. I'm using the following Method within the silverlight c# code once the data has been bound to the placeholder control.

    HtmlPage.Window.NavigateToBookmark(bookmark);

    I have also tried invoking javascript methods from the silverlight application such as scrollIntoView once I have the element, but this doesn't work either.

    The interesting part is that within FireFox and Chrome I see the content initially scroll to the bookmark in the content, but then it ends up scrolling right back up to the top of the page immediately after. Is this a known behavior?

    Thanks in advance.

     

     

     

     

     

     

     

     

  2. Dan Normington
    Dan Normington avatar
    6 posts
    Member since:
    Jun 2009

    Posted 01 Jul 2009 Link to this post

    Now I'm finding that it isn't working within Internet Explorer as well. After doing some testing It seems to be a timing issue. If I put an alert popup prior to the HtmlPage.Window.NavigateToBookmark(bookmark); method call it seems to work OK. Is there any event on the placeholder control that tells me that it has completed all rendering/loading?
  3. DevCraft banner
  4. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 03 Jul 2009 Link to this post

    Hi Dan Normington,

    Sorry for the late response to your problem.

    We can't get a notification about when the html is rendered in the browser. You can solve your problem by using a timer to check when anchor is already rendered. Please check the attached solution and let us know if you need more info.

    Best wishes,
    Valentin.Stoychev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Dan Normington
    Dan Normington avatar
    6 posts
    Member since:
    Jun 2009

    Posted 03 Jul 2009 Link to this post

    Thanks for the response. I ended up writing my own html host control that appears to be working in firefox, IE, and chrome. Bookmarks are scrolled to correctly in all versions.
Back to Top