473,624 Members | 2,534 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
nj********@hotm ail.com
http://www.nathansokalski.com/
Nov 19 '05 #1
2 1349
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
nj********@hotm ail.com
http://www.nathansokalski.com/


Nov 19 '05 #2
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
nj********@hotm ail.com
http://www.nathansokalski.com/
<la*******@gmai l.com> wrote in message
news:11******** *************@g 49g2000cwa.goog legroups.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
nj********@hotm ail.com
http://www.nathansokalski.com/

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1108
by: Jonathan Hollinger | last post by:
Very, very strange problem. In developing a C# ASP.NET application, every so often, DataLists disappear from the build. They remain visible and rendered (though sometimes dropping properties and event handlers) but do not seem to be included in the build (and are consequently not rendered on the web page). I've looked into the problem throughly, comparing output library sizes and it seems as though DataLists (all datalists on a page)...
0
912
by: Jonathan Hollinger | last post by:
Very, very strange problem. In developing a C# ASP.NET application, every so often, DataLists disappear from the build. They remain visible and rendered (though sometimes dropping properties and event handlers) but do not seem to be included in the build (and are consequently not rendered on the web page). I've looked into the problem throughly, comparing output library sizes and it seems as though DataLists (all datalists on a page)...
2
1069
by: Diffident | last post by:
Hello All, I have a question on datalists. I have 5 datalists on a page and when I try to view the "ViewSource", the value for the __VIEWSTATE is empty. How do datalists persist their values? I am not binding the datalist each and every time. Strangely whenever I try to access datalist elements from Datalist_ItemCommand it is maintaining it's viewstate. How is this possible?
7
2131
by: Nathan Sokalski | last post by:
I have a page which I dynamically add several usercontrols (*.ascx files) to using the following code: Public Sub Refresh() For Each section As DataRow In Me.GetSections().Rows CType(Me.FindControl("admin" & CStr(section("buttontext")).Replace(" ", "")), adminsection2).RefreshSection() Next End Sub
0
8231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8168
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8614
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8330
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6107
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4075
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4167
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1474
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.