Late binding the template

8 posts, 2 answers
  1. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 18 May 2009 Link to this post

    I've been playing with this example from the code library and wondered if it were possible to modify it so that the templated content is late bound.

    What I'm trying to do is this: I have a PanelBar with a TreeView as the templated content. I don't want to bind any TreeView until and unless the relevant PanelBar item is clicked on to expand it.

    Any thoughts would be much appreciated.

    Ta.

    --
    Stuart
  2. Answer
    Paul
    Admin
    Paul avatar
    4281 posts

    Posted 18 May 2009 Link to this post

    Hello Stuart,

    Please refer to this forum post for tips on the matter.

    Sincerely yours,
    Paul
    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.
  3. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 18 May 2009 Link to this post

    Paul,

    Thanks for that.

    I'll get back to you when I've tried to fit it in.

    Many Thanks.

    --
    Stuart
  4. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 20 May 2009 Link to this post

    Paul,

    Thanks. That post provided most of what I needed.

    One of the things my user needed was for the PanelBar's ExpandMode to be set to MultipleExpandedItems so I moved the code to load the content in to the page's OnPreRender event after testing to see if each PanelBar item was expanded.


    --
    Stuart
  5. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 20 May 2009 Link to this post

    I forgot to say, if anyone want's to see how you can do this with multiple open items, mail me at sejhemming at gmail dot com

    --
    Stuart
  6. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 20 May 2009 Link to this post

    One thing that you might not appreciate with this approach is that you have to data bind your content control each time that page posts back which means that its state (in the case of a treeview, to expanded and/or selected state) or each node is lost. So, if you want to retain the state you've got to do it yourself as part of your content control.

    So, to prevent me from, potentially, reinventing the wheel; is there a way of serializing the state of a treeview's node collection?

    --
    Stuart
  7. Answer
    Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 21 May 2009 Link to this post

    Hello Stuart Hemming,

    You can use the GetXml method of the treeview.

    Kind regards,
    Albert
    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.
  8. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 21 May 2009 Link to this post

    Thanks Albert, I'd missed that one.

    --
    Stuart
Back to Top