473,395 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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="dlstMyDataList_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 3853
Isn't there the possibility to replace your table by <div> tags?

On 2004-12-04 10:49:56 -0300, Martman <on*******@nospam.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="dlstMyDataList_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*****@centraldev.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*******@nospam.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="dlstMyDataList_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*******@nospam.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*****@centraldev.net> wrote in message
news:2004120412305551872%marcelo@centraldevnet...
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*******@nospam.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*******@nospam.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
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...
0
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....
2
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...
8
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...
5
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...: ...
6
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...
3
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...
1
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...
1
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)....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.