scm0sml
asked on
giving each row of my datalist a 'header'
I have a datalist and have set the repeatcolumsn property to 15.
Each 'item' consists of a table with 3 rows.
What I want is at the beginning of each row is to have a simliar table with a title displaying what each row represents, so basically need a 'header' at the beginning of each 'row' when i pass the 15 columns.
is this possible?
I have attached my datalist at present
Each 'item' consists of a table with 3 rows.
What I want is at the beginning of each row is to have a simliar table with a title displaying what each row represents, so basically need a 'header' at the beginning of each 'row' when i pass the 15 columns.
is this possible?
I have attached my datalist at present
<asp:DataList ID="dlCabins" Runat="server" RepeatDirection="horizontal" RepeatColumns="15">
<HeaderTemplate>
<br />
<b><% =TranslateMe("Ensure you save any changes before hiding these cabins") %>.</b>
<br /><br />
</HeaderTemplate>
<ItemTemplate>
<table border="0" cellpadding="0" cellspacing="0" style="border: solid 1px black; text-align:center;">
<tr>
<td>
<input type="hidden" runat="server" id="hddncabinid" value='<%# Container.Dataitem().CruiseCabin_ID %>' />
<table border="0" cellpadding="0" cellspacing="0" style="text-align:center;">
<tr class="DeckTableRow">
<td style="height:15px; text-align:center; width:100%">
<i><%# Container.ItemIndex + 1 %></i>
</td>
</tr>
<tr>
<td style="height:30px; width:35px">
<asp:TextBox runat="server" width="30px" ID="txtCabinNo" Text='<%# Container.Dataitem().CabinNumber %>'></asp:TextBox>
</td>
</tr>
<tr class="DeckTableRow">
<td style="height:30px; text-align:center; width:100%">
<asp:Label ID="lblPriority" runat="server" Text='<%# Container.Dataitem().Priority %>'></asp:Label>
</td>
</tr>
</table>
</td>
</ItemTemplate>
<FooterTemplate>
</tr>
</table>
</FooterTemplate>
</asp:DataList>
ASKER
I have now amended the datalist slightly and attached, this gives me the titles for each item whereas i only want it for each row.
<asp:DataList ID="dlCabins" Runat="server" RepeatDirection="horizontal" RepeatColumns="15">
<HeaderTemplate>
<br />
<b><% =TranslateMe("Ensure you save any changes before hiding these cabins") %>.</b>
<br /><br />
</HeaderTemplate>
<ItemTemplate>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="text-align:center;">
<tr class="DeckTableRow">
<td style="height:15px">
 
</td>
</tr>
<tr>
<td style="height:30px">
<b>No</b>
</td>
</tr>
<tr class="DeckTableRow">
<td style="height:30px">
<b>Pr</b>
</td>
</tr>
</table>
</td>
<td>
<input type="hidden" runat="server" id="hddncabinid" value='<%# Container.Dataitem().CruiseCabin_ID %>' />
<table border="0" cellpadding="0" cellspacing="0" style="text-align:center;">
<tr class="DeckTableRow">
<td style="height:15px; text-align:center; width:100%">
<i><%# Container.ItemIndex + 1 %></i>
</td>
</tr>
<tr>
<td style="height:30px; width:35px">
<asp:TextBox runat="server" width="30px" ID="txtCabinNo" Text='<%# Container.Dataitem().CabinNumber %>'></asp:TextBox>
</td>
</tr>
<tr class="DeckTableRow">
<td style="height:30px; text-align:center; width:100%">
<asp:Label ID="lblPriority" runat="server" Text='<%# Container.Dataitem().Priority %>'></asp:Label>
</td>
</tr>
</table>
</td>
</ItemTemplate>
<FooterTemplate/>
</asp:DataList>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
perfect thanks for that!!
Welcome !! :)
ASKER
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="text-align:center;"
<tr class="DeckTableRow">
<td style="height:15px">
 
</td>
</tr>
<tr>
<td style="height:30px">
<b>No</b>
</td>
</tr>
<tr class="DeckTableRow">
<td style="height:30px">
<b>Pr</b>
</td>
</tr>
</table>
</td>