Professional Web Applications Themes

Dynamically Adding DataLists - ASP.NET Data Grid Control

I have a page on which I want to display several sections each of which contain a list of names. I have two database tables, one of which contains the section headings, and the other contains the names and which section they belong to. I would like to use databinding to display this information, preferably using DataLists. However, because the number of sections will vary, the DataLists will need to be added dynamically. But because DataLists use templates, I do not know how to do this. All of the DataLists will have identical templates, but I do not know how ...

  1. #1

    Default Dynamically Adding DataLists

    I have a page on which I want to display several sections each of which
    contain a list of names. I have two database tables, one of which contains
    the section headings, and the other contains the names and which section
    they belong to. I would like to use databinding to display this information,
    preferably using DataLists. However, because the number of sections will
    vary, the DataLists will need to be added dynamically. But because DataLists
    use templates, I do not know how to do this. All of the DataLists will have
    identical templates, but I do not know how to create the template when the
    DataList is added dynamically. Can someone help me here? Thanks.
    --
    Nathan Sokalski
    [email]njsokalskihotmail.com[/email]
    [url]http://www.nathansokalski.com/[/url]


    Nathan Sokalski Guest

  2. #2

    Default Re: Dynamically Adding DataLists

    You can create an array of datalist. you will have to also create a
    couple of functions that will return your template columns.

    Thanks
    Keith Lang
    Nathan Sokalski wrote:
    > I have a page on which I want to display several sections each of which
    > contain a list of names. I have two database tables, one of which contains
    > the section headings, and the other contains the names and which section
    > they belong to. I would like to use databinding to display this information,
    > preferably using DataLists. However, because the number of sections will
    > vary, the DataLists will need to be added dynamically. But because DataLists
    > use templates, I do not know how to do this. All of the DataLists will have
    > identical templates, but I do not know how to create the template when the
    > DataList is added dynamically. Can someone help me here? Thanks.
    > --
    > Nathan Sokalski
    > [email]njsokalskihotmail.com[/email]
    > [url]http://www.nathansokalski.com/[/url]
    langdaddy@gmail.com Guest

  3. #3

    Default Re: Dynamically Adding DataLists

    There are two problems with that. First, whether or not the DataLists came
    from an array or not is irrelevant, because they are going to be added to
    the Controls Collection. Second, my template is not made up of just columns.
    As I am assuming you know, a template can contain almost any ASP.NET
    controls that can be used anywhere else, and my templates will be more than
    just a set of columns. Any other ideas? Thanks.
    --
    Nathan Sokalski
    [email]njsokalskihotmail.com[/email]
    [url]http://www.nathansokalski.com/[/url]
    <langdaddy> wrote in message
    news:1131339013.272206.77070g49g2000cwa.googlegro ups.com...
    > You can create an array of datalist. you will have to also create a
    > couple of functions that will return your template columns.
    >
    > Thanks
    > Keith Lang
    > Nathan Sokalski wrote:
    >> I have a page on which I want to display several sections each of which
    >> contain a list of names. I have two database tables, one of which
    >> contains
    >> the section headings, and the other contains the names and which section
    >> they belong to. I would like to use databinding to display this
    >> information,
    >> preferably using DataLists. However, because the number of sections will
    >> vary, the DataLists will need to be added dynamically. But because
    >> DataLists
    >> use templates, I do not know how to do this. All of the DataLists will
    >> have
    >> identical templates, but I do not know how to create the template when
    >> the
    >> DataList is added dynamically. Can someone help me here? Thanks.
    >> --
    >> Nathan Sokalski
    >> [email]njsokalskihotmail.com[/email]
    >> [url]http://www.nathansokalski.com/[/url]
    >

    Nathan Sokalski Guest

Similar Threads

  1. Dynamically Adding Controls
    By Nathan Sokalski in forum ASP.NET Building Controls
    Replies: 9
    Last Post: November 25th, 03:21 PM
  2. Dynamically adding DSN?
    By Phyte@Omegabyte in forum Coldfusion - Advanced Techniques
    Replies: 1
    Last Post: July 6th, 12:03 PM
  3. Adding columns dynamically
    By Peter Kamitz in forum ASP.NET Data Grid Control
    Replies: 2
    Last Post: March 2nd, 06:11 PM
  4. adding buttons dynamically
    By evya in forum Macromedia Flash Actionscript
    Replies: 1
    Last Post: February 19th, 08:42 PM
  5. dynamically adding to HEAD tag
    By in forum ASP.NET General
    Replies: 7
    Last Post: August 17th, 04:51 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139