473,599 Members | 3,118 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Modify Datalist standard itemtemplate output

First here is my goal:

When a datalist is rendered to a page and you use the <itemtemplate > the
datalist automatically prints a <tr> <td> start and end tags. Now this
may not be too bad but I have run into a situation repeatedly with the
designing factor of a datalist.

Most of the time when I use a datalist I utilize the header, item, and
footer templates to build a custom table. However, utilizing the simple
example below you will see why this is a problem.

My datalist in code:

<headertemplate >
<table width="100%" summary="Table displays a list of info">
<tr>
<th scope="col"></th>
<tr>
</headertemplate>
<itemtemplate >
<tr>
<td scope="row"></td>
</tr>
</itemtemplate>
<footertemplate >
</table>
</footertemplate>
I have to build Section 508 compliant web pages for handicap
accessibility which .Net does not do very well. Now with the above
DataList the actual output would be like the following:

<table id="dlstMyDataL ist_skdis">
<tr>
<td>
<table width="100%" summary="Table displays a list of info">
<tr>
<th scope="col"></th>
<tr>
</td>
</tr>
<tr>
<td>
<tr>
<td scope="row"></td>
</tr>
</td>
</tr>
</table>
</table>

As you can see this is not a very well formed table and can cause
enormous problems with page layouts and 508 issues. Is there any way I
can override the way that .Net outputs the DataList object so that I can
effectively have a correctly designed table?

Thanks
Marty U
Nov 19 '05 #1
5 3861
Isn't there the possibility to replace your table by <div> tags?

On 2004-12-04 10:49:56 -0300, Martman <on*******@nosp am.com> said:
First here is my goal:

When a datalist is rendered to a page and you use the <itemtemplate >
the datalist automatically prints a <tr> <td> start and end tags. Now
this may not be too bad but I have run into a situation repeatedly with
the designing factor of a datalist.

Most of the time when I use a datalist I utilize the header, item, and
footer templates to build a custom table. However, utilizing the simple
example below you will see why this is a problem.

My datalist in code:

<headertemplate >
<table width="100%" summary="Table displays a list of info">
<tr>
<th scope="col"></th>
<tr>
</headertemplate>
<itemtemplate >
<tr>
<td scope="row"></td>
</tr>
</itemtemplate>
<footertemplate >
</table>
</footertemplate>
I have to build Section 508 compliant web pages for handicap
accessibility which .Net does not do very well. Now with the above
DataList the actual output would be like the following:

<table id="dlstMyDataL ist_skdis">
<tr>
<td>
<table width="100%" summary="Table displays a list of info">
<tr>
<th scope="col"></th>
<tr>
</td>
</tr>
<tr>
<td>
<tr>
<td scope="row"></td>
</tr>
</td>
</tr>
</table>
</table>

As you can see this is not a very well formed table and can cause
enormous problems with page layouts and 508 issues. Is there any way I
can override the way that .Net outputs the DataList object so that I
can effectively have a correctly designed table?

Thanks
Marty U

--

Marcelo Hernán Ruiz
--------------------------------------------------
Centraldev.net
Diseño, Desarrollo y Consultoría Tecnológica
Email: ma*****@central dev.net
Tel: (54-11) 4856-3076
Móvil: (54-11) 15-5388-8068
Web: www.centraldev.net

Nov 19 '05 #2
Marcelo Hernán Ruiz wrote:
Isn't there the possibility to replace your table by <div> tags?

On 2004-12-04 10:49:56 -0300, Martman <on*******@nosp am.com> said:
First here is my goal:

When a datalist is rendered to a page and you use the <itemtemplate >
the datalist automatically prints a <tr> <td> start and end tags. Now
this may not be too bad but I have run into a situation repeatedly
with the designing factor of a datalist.

Most of the time when I use a datalist I utilize the header, item, and
footer templates to build a custom table. However, utilizing the
simple example below you will see why this is a problem.

My datalist in code:

<headertemplate >
<table width="100%" summary="Table displays a list of info">
<tr>
<th scope="col"></th>
<tr>
</headertemplate>
<itemtemplate >
<tr>
<td scope="row"></td>
</tr>
</itemtemplate>
<footertemplate >
</table>
</footertemplate>
I have to build Section 508 compliant web pages for handicap
accessibility which .Net does not do very well. Now with the above
DataList the actual output would be like the following:

<table id="dlstMyDataL ist_skdis">
<tr>
<td>
<table width="100%" summary="Table displays a list of info">
<tr>
<th scope="col"></th>
<tr>
</td>
</tr>
<tr>
<td>
<tr>
<td scope="row"></td>
</tr>
</td>
</tr>
</table>
</table>

As you can see this is not a very well formed table and can cause
enormous problems with page layouts and 508 issues. Is there any way I
can override the way that .Net outputs the DataList object so that I
can effectively have a correctly designed table?

Thanks
Marty U


Actually no, especially when the data is related data and must be
rendered to be 508 compliant. Hence the scope tags and actually those
are the cheaters way of making a list of data copliant. I have been
doing some research and think I can use the templatebuilder class but I
need to inherit the datalist control so I can have the functionality of
the databinding, methods, and properties but just have a custom output
so that when you add a datalist to the page it will only render a table
and no tr or td tags so I can embed my own header, footer and item
templates.

Can someone give me an idea of how I can create a composite control with
custom template items but inherit all the functionality of a datalist.

Thanks

Marty U.
Nov 19 '05 #3
And what about the Repeater control? It has almost the same
functionality of the DataList, but uses no tables.

On 2004-12-04 12:03:55 -0300, Martman <on*******@nosp am.com> said:
Actually no, especially when the data is related data and must be
rendered to be 508 compliant. Hence the scope tags and actually those
are the cheaters way of making a list of data copliant. I have been
doing some research and think I can use the templatebuilder class but I
need to inherit the datalist control so I can have the functionality of
the databinding, methods, and properties but just have a custom output
so that when you add a datalist to the page it will only render a table
and no tr or td tags so I can embed my own header, footer and item
templates.

Can someone give me an idea of how I can create a composite control
with custom template items but inherit all the functionality of a
datalist.

Thanks

Marty U.


--

Marcelo Hernán Ruiz
--------------------------------------------------
Centraldev.net
Diseño, Desarrollo y Consultoría Tecnológica
Web: www.centraldev.net

Nov 19 '05 #4
This may be of help / interest

http://support.microsoft.com/default...b;EN-US;823030

Cheers, Pete

"Marcelo Hernán Ruiz" <ma*****@centra ldev.net> wrote in message
news:2004120412 305551872%marce lo@centraldevne t...
And what about the Repeater control? It has almost the same
functionality of the DataList, but uses no tables.

On 2004-12-04 12:03:55 -0300, Martman <on*******@nosp am.com> said:
Actually no, especially when the data is related data and must be
rendered to be 508 compliant. Hence the scope tags and actually those
are the cheaters way of making a list of data copliant. I have been
doing some research and think I can use the templatebuilder class but I
need to inherit the datalist control so I can have the functionality of
the databinding, methods, and properties but just have a custom output
so that when you add a datalist to the page it will only render a table
and no tr or td tags so I can embed my own header, footer and item
templates.

Can someone give me an idea of how I can create a composite control
with custom template items but inherit all the functionality of a
datalist.

Thanks

Marty U.


--

Marcelo Hernán Ruiz
--------------------------------------------------
Centraldev.net
Diseño, Desarrollo y Consultoría Tecnológica
Web: www.centraldev.net

Nov 19 '05 #5
Marcelo Hernán Ruiz wrote:
And what about the Repeater control? It has almost the same
functionality of the DataList, but uses no tables.

On 2004-12-04 12:03:55 -0300, Martman <on*******@nosp am.com> said:
Actually no, especially when the data is related data and must be
rendered to be 508 compliant. Hence the scope tags and actually those
are the cheaters way of making a list of data copliant. I have been
doing some research and think I can use the templatebuilder class but
I need to inherit the datalist control so I can have the functionality
of the databinding, methods, and properties but just have a custom
output so that when you add a datalist to the page it will only render
a table and no tr or td tags so I can embed my own header, footer and
item templates.

Can someone give me an idea of how I can create a composite control
with custom template items but inherit all the functionality of a
datalist.

Thanks

Marty U.


The repeater control does not have some of the functionality of the
datalist control such as the DataKeyField property.
Nov 19 '05 #6

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

Similar topics

2
3238
by: Todd | last post by:
I am somewhat new to ASP.NET and I am probably overlooking some basic rule that's causing my error. Anyways, here's the scoop: I am using a DataReader to access a SQL stored procedure. I want the result set from the DataReader to be dumped into a DataList and displayed on the page. I already know that my data, the stored procedure, and the database connectivity all work correctly because I have outputted all this data to a dataGrid...
0
3094
by: Alex | last post by:
Interested in more .NET stuff visit www.dedicatedsolutions.co.uk The DataList is not as powerful as the DataGrid. It requires more work from you since it has no default data presentation format. However, the DataGrid begins to get very cumbersome as the number of columns of data you present increases. Anything more than half a dozen columns or so and you probably induce horizontal scrolling - a real no-no for me. If you put such a...
2
325
by: IGotYourDotNet | last post by:
Can anyone tell me how to find a table within a datalist? I can find the labels and textboxes in the dl and change the formatting based on the data, but I can't find the table in the DL. Can anyone point me to a code sniippet or something on finding a table in the datalist?
8
5884
by: bienwell | last post by:
Hi, I have a problem of displaying data bound by a datalist control. In my table, I have a field Start_date which has Short Date data type. I tried to update this field by Current Date. After that, I display End_Date on the DataList control. The output looks like 3/18/2005 12:00:00 AM . I'd like to format data for this field to be 3/18/2005. Please help me. Thanks in advance....
5
3758
by: Ben Fidge | last post by:
I'm using DataList to present tabular data but am often having problems with some rows column alignment being out of synch with the rest of the rows. My DataList looks similar to this...: <asp:datalist id="DataList1" runat="server"> <HeaderTemplate> <table border="0" cellpadding="0" cellspacing="0" width="400"> <tr> <td width="100">First Name</td>
6
9573
by: Paul | last post by:
I am trying to use a DataList and the ItemTemplate. I am binding the Datalist to a SQL query that gives me a list of Items with a Parent Category. I want to loop through all the items, but only print the Parent Category once, regardless of how many child items are in it. So my perfect output would look something like:
3
10288
by: Mirek Endys | last post by:
I have DataList as part of DataList item. DataList in DataList. The parent DataList working well including Edit command, that shows Edit template and correctly bind the data into edit template (where is the child DataList).... But in case I want to make Edit in this child DataList it is not working... No edit template showed... :( this is a code that i use for the child DataList... Edit command // this is for child DataList...
1
2656
by: AJ | last post by:
Hi all, With the following code in mind : <asp:DataList ID="dlOne" DataKeyField="myField1" DataSource="<%# GetDataSource1()" Runat="server"> <ItemTemplate> Output Value Here! <asp:DataList ID="dlTwo" DataKeyField="myField2" DataSource="<%# GetDataSource2(?,?)" Runat="server">
1
2021
by: berny.zamora | last post by:
Hello everyone, I have a composite control (lets call it the parent) that contains a datalist. The datalist has an ItemTemplate that contains another composite control (lets call it the child). I am trying to create a property at the parent control that sets a property in the child instances. So for example lets say I am creating a control that displays a list of hotel reservations for a group of people.
0
7992
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
7904
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,...
1
8051
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,...
0
6725
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5438
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3898
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
3940
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2414
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1250
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.