473,385 Members | 1,320 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,385 software developers and data experts.

Using DataList - table and headers

Hello,

Im often use DataList for viewing and editing datas. For better layout
controling, I create a table in the template and there I put other controls
or binding data into table cells.

Sometimes, I would use the HeaderTemplate as header of my table (in
ItemTemplate).
How to do it? How to make the table columns in HeaderTemplate linked to
table columns in ItemTemplate?

Thanks.

Mirek.
Nov 21 '05 #1
2 13355
Mirek,

Wrap the table around the datalist like this:
<table>
<asp:DataList ...>
<HeaderTemplate>
<tr>...</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>...</tr>
</ItemTemplate>
</asp:DataList>
</table>

Eliyahu

"Mirek Endys" <Mi****@community.nospam> wrote in message
news:uy*************@TK2MSFTNGP15.phx.gbl...
Hello,

Im often use DataList for viewing and editing datas. For better layout
controling, I create a table in the template and there I put other
controls or binding data into table cells.

Sometimes, I would use the HeaderTemplate as header of my table (in
ItemTemplate).
How to do it? How to make the table columns in HeaderTemplate linked to
table columns in ItemTemplate?

Thanks.

Mirek.

Nov 21 '05 #2
The datalist exposes a property named RepeatLayout which can have a value of
either Table or Flow. To experiment with both outcome try this sample from
the MSDN:
http://msdn.microsoft.com/library/de...ayouttopic.asp

The RepeatLayout=Flow would produce a span for each datalist item being
rendered on the browser. This would prevent you from enclosing the entire
datalist in a <Table> (where the header is only a Tablerow and each item in
the body is another TableRow as the repeater would do).

Therefore you should use CSS to align the columns within different tables by
specifying the TD width values as I did in this sample:
http://www.societopia.net/samples/Da...Hierarchy.aspx

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Mirek Endys" wrote:
Hello,

Im often use DataList for viewing and editing datas. For better layout
controling, I create a table in the template and there I put other controls
or binding data into table cells.

Sometimes, I would use the HeaderTemplate as header of my table (in
ItemTemplate).
How to do it? How to make the table columns in HeaderTemplate linked to
table columns in ItemTemplate?

Thanks.

Mirek.

Nov 21 '05 #3

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

Similar topics

0
by: Barry | last post by:
Hi, I have a Datalist inside the ItemTemplate of another DataList. When I drilldown, I'm not getting any data in either the itemtemplate or headertemplate of the second DataList. I've confirmed...
1
by: mahsa | last post by:
H data I'm binding to the DataList is information about products in my product database. Perhaps passed in the QueryString to this page is a ProductID. I might want to make the item in the DataList...
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...
4
by: Miguel Dias Moura | last post by:
Hello, I created a datalist in an ASP.Net / VB page. I display the image and price of a few products. When a user clicks an image I want to load the page "detail.aspx?number=id" and send the...
5
by: Martman | last post by:
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...
6
by: tshad | last post by:
I need to get to a status label I have on my footer section of my datalist. There is no event happening that would go to the footer. I am just doing some processing and want to update the label...
1
by: Craig | last post by:
This is killing me, I've been trying to figure this out for 2 days. When I click on the linkbutton, it executes the GetData(int) method to set the DataSource. The FAILURE is when it tries to...
3
by: mayankaswal | last post by:
I am using a DataList and I have used a PlaceHolder to generate the Headers and Items. The problem is when the items list is big and I scroll down, the header also moves. I am trying the header to be...
0
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I am having this problem. I have this datalist and whenever I expand the datalist by the plus button, it overlaps other controls on my web page and sometimes these controls come...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.