[Beta 3] FIX: TreeView doesn't handle expanded state for second and subsequent TreeView instances on same page

Last post 11-01-2006 8:24 PM by Russ Helfand. 1 replies.

Sort Posts:

  • [Beta 3] FIX: TreeView doesn't handle expanded state for second and subsequent TreeView instances on same page

    11-01-2006, 6:54 PM
    • Member
      185 point Member
    • IDisposable
    • Member since 04-13-2006, 5:50 PM
    • St. Louis, MO, USA, NA, Earth, Sol, Milky Way
    • Posts 37

    If you have a page with multiple TreeView instances, only the first one will have it's expanded/collapsed state correctly set when the page loads/reloads. This is due to a tiny error in the TreeViewAdapter.cs SaveAdapterViewState method.
    Replace this line:

    Page.ClientScript.RegisterOnSubmitStatement(GetType(), GetType().ToString(), script);

    With this:

    Page.ClientScript.RegisterOnSubmitStatement(typeof(TreeViewAdapter), _viewState.ClientID, script);
    
    http://musingmarc.blogspot.com
  • Re: [Beta 3] FIX: TreeView doesn't handle expanded state for second and subsequent TreeView instances on same page

    11-01-2006, 8:24 PM
    • Contributor
      3,298 point Contributor
    • Russ Helfand
    • Member since 09-14-2005, 2:22 PM
    • Groovybits.com
    • Posts 741
    Nice catch, Marc.  I'll fix it in the next rev.  Thanks.
    Russ Helfand
    Groovybits.com
Page 1 of 1 (2 items)