This is a migrated thread and some comments may be shown as answers.

Late binding the template

7 Answers 78 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Stuart Hemming
Top achievements
Rank 2
Stuart Hemming asked on 18 May 2009, 10:49 AM
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

7 Answers, 1 is accepted

Sort by
0
Accepted
Paul
Telerik team
answered on 18 May 2009, 11:01 AM
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.
0
Stuart Hemming
Top achievements
Rank 2
answered on 18 May 2009, 11:18 AM
Paul,

Thanks for that.

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

Many Thanks.

--
Stuart
0
Stuart Hemming
Top achievements
Rank 2
answered on 20 May 2009, 07:58 AM
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
0
Stuart Hemming
Top achievements
Rank 2
answered on 20 May 2009, 08:00 AM
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
0
Stuart Hemming
Top achievements
Rank 2
answered on 20 May 2009, 09:00 AM
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
0
Accepted
Atanas Korchev
Telerik team
answered on 21 May 2009, 08:54 AM
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.
0
Stuart Hemming
Top achievements
Rank 2
answered on 21 May 2009, 08:59 AM
Thanks Albert, I'd missed that one.

--
Stuart
Tags
PanelBar
Asked by
Stuart Hemming
Top achievements
Rank 2
Answers by
Paul
Telerik team
Stuart Hemming
Top achievements
Rank 2
Atanas Korchev
Telerik team
Share this question
or