Home All Groups Group Topic Archive Search About

Dynamically Adding DataLists

Author
6 Nov 2005 10:30 PM
Nathan Sokalski
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
njsokal***@hotmail.com
http://www.nathansokalski.com/

Author
7 Nov 2005 4:50 AM
langdaddy
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:
Show quote
> 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
> njsokal***@hotmail.com
> http://www.nathansokalski.com/
Author
8 Nov 2005 5:51 AM
Nathan Sokalski
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
njsokal***@hotmail.com
http://www.nathansokalski.com/
<langda***@gmail.com> wrote in message
Show quote
news:1131339013.272206.77070@g49g2000cwa.googlegroups.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
>> njsokal***@hotmail.com
>> http://www.nathansokalski.com/
>

AddThis Social Bookmark Button