Hierarchical binding in a WebServer Control with templates

Discussion in 'ASP .Net Building Controls' started by Iain, Jun 15, 2004.

  1. Iain

    Iain Guest

    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
     
    Iain, Jun 15, 2004
    #1
    1. Advertising

  2. "Iain" <> wrote in message
    news:...
    > 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.
    --
    John Saunders
    johnwsaundersiii at hotmail
     
    John Saunders, Jun 15, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. neverstill

    Binding hierarchical data

    neverstill, Dec 8, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    1,220
    Anders Borum
    Dec 9, 2003
  2. Kent Boogaart

    Binding to Hierarchical Data Source (FAQs)

    Kent Boogaart, Feb 1, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    2,646
  3. Fred
    Replies:
    1
    Views:
    635
    Neredbojias
    Sep 26, 2005
  4. JKop
    Replies:
    3
    Views:
    526
  5. recover
    Replies:
    2
    Views:
    862
    recover
    Jul 25, 2006
Loading...

Share This Page