Dynamically Adding DataLists

Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  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]njsokalski@hotmail.com[/email]
    [url]http://www.nathansokalski.com/[/url]


    Nathan Sokalski Guest

  2. Similar Questions and Discussions

    1. Dynamically adding DSN?
      I need to add DSN's to CF server on the fly when a user signs up for my billing software. I've searched around google and can't find anything that...
    2. Dynamic Datalists
      Hey, I have created a datalist dynamically and add the DataBinding event to the label controls. Now the event is called and everything works....
    3. Adding columns dynamically
      hi, I always get the error: Item has already been added. Key in dictionary: "0" Key being added: "0" ----when trying to databind the webgrid with...
    4. Dynamically adding a row into an gridview
      Hi All, I want to dynamically add a row in my gridview. I want to have a row beneath my headerrow with dropdowns in it, which I can use to filter...
    5. Dynamically adding buttons to each row: how?
      I'm working on a web application that will use some datagrid and asp.net, an asp.net Forum to be exact where people can leave posts and respond to...
  3. #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]njsokalski@hotmail.com[/email]
    > [url]http://www.nathansokalski.com/[/url]
    langdaddy@gmail.com Guest

  4. #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]njsokalski@hotmail.com[/email]
    [url]http://www.nathansokalski.com/[/url]
    <langdaddy@gmail.com> wrote in message
    news:1131339013.272206.77070@g49g2000cwa.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]njsokalski@hotmail.com[/email]
    >> [url]http://www.nathansokalski.com/[/url]
    >

    Nathan Sokalski Guest

Posting Permissions

  • You may not post new threads
  • You may 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