Hierarchical binding in a WebServer Control with templates

I

Iain

I want to build a templated control which will be the graphical
representation of a complex object.

So the object has a list of items (line items on an order) and some items
can contain other items (specifically, some items can be custom CDs with
individual tracks on).

So I when I come to render I want to bind to the object and enumerate
through the collection. But when I come to an item which contains other
items I want to use a different set of templates, specifically with
templates for each sub item.

I sort of understand templated databinding, but I'm struggling with the
relationship between CreateControls and Render on this one.

Any advice out there?

Iain
 
J

John Saunders

Iain said:
I want to build a templated control which will be the graphical
representation of a complex object.

So the object has a list of items (line items on an order) and some items
can contain other items (specifically, some items can be custom CDs with
individual tracks on).

So I when I come to render I want to bind to the object and enumerate
through the collection. But when I come to an item which contains other
items I want to use a different set of templates, specifically with
templates for each sub item.

I sort of understand templated databinding, but I'm struggling with the
relationship between CreateControls and Render on this one.

Any advice out there?

Sure, you could have a template for an item and one for subitems. If
necessary, you could have a template for each kind of subitem. Just add an
ITemplate property for each possible kind of subitem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top