Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > multiple <td> in a repeater control <ItemTemplate> (asp.net 2)

Reply
Thread Tools

multiple <td> in a repeater control <ItemTemplate> (asp.net 2)

 
 
webserverpete@ebtech.net
Guest
Posts: n/a
 
      08-16-2005
I would like to have multiple <td> in a repeater control. The below
code does not work:
<asp:Repeater ID="Repeater1" runat="server"
DataSourceID="SqlDataSource1" DataMember="DefaultView">
<HeaderTemplate>
<table>
</HeaderTemplate>
<tr>
<ItemTemplate>
<td>
<%#DataBinder.Eval(Container.DataItem, "itemname")%>
$<%#FormatNumber(DataBinder.Eval(Container.DataIte m, "itemprice"), 2)%>

<img src="images/<%#DataBinder.Eval(Container.DataItem,
"picfilename")%>">
<%#DataBinder.Eval(Container.DataItem, "itemdescription")%>
<%#DataBinder.Eval(Container.DataItem, "itemaddtime")%>
</td>
</ItemTemplate>
</tr>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>

The problem with the above is the <tr>, if I take that out then that
page works. However this does not produce the disired results. I would
like to have more than five <td> in a <tr>, essentially wrapping the
<ItemTemplate> tag with <tr> tags and only repeating the <ItemTemplate>
five times.

Any help would be greatly appreciated,
Pete

 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      08-16-2005
Pete,

If I understand you correctly, you want to have just one row and the
repeater items as cells? In this case you should use

<HeaderTemplate>
<table><tr>
</HeaderTemplate>

and

<FooterTemplate>
</tr></table>
</FooterTemplate>

Eliyahu

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> I would like to have multiple <td> in a repeater control. The below
> code does not work:
> <asp:Repeater ID="Repeater1" runat="server"
> DataSourceID="SqlDataSource1" DataMember="DefaultView">
> <HeaderTemplate>
> <table>
> </HeaderTemplate>
> <tr>
> <ItemTemplate>
> <td>
> <%#DataBinder.Eval(Container.DataItem, "itemname")%>
> $<%#FormatNumber(DataBinder.Eval(Container.DataIte m, "itemprice"), 2)%>
>
> <img src="images/<%#DataBinder.Eval(Container.DataItem,
> "picfilename")%>">
> <%#DataBinder.Eval(Container.DataItem, "itemdescription")%>
> <%#DataBinder.Eval(Container.DataItem, "itemaddtime")%>
> </td>
> </ItemTemplate>
> </tr>
> <FooterTemplate>
> </table>
> </FooterTemplate>
> </asp:Repeater>
>
> The problem with the above is the <tr>, if I take that out then that
> page works. However this does not produce the disired results. I would
> like to have more than five <td> in a <tr>, essentially wrapping the
> <ItemTemplate> tag with <tr> tags and only repeating the <ItemTemplate>
> five times.
>
> Any help would be greatly appreciated,
> Pete
>



 
Reply With Quote
 
 
 
 
webserverpete@ebtech.net
Guest
Posts: n/a
 
      08-16-2005
That is almost what I was looking for. I would like to have every five
records returned to be in their own set of <tr> tags so there would be
more than one set of <tr> tags.

Thanks again for your help,
Pete

Eliyahu Goldin wrote:
> Pete,
>
> If I understand you correctly, you want to have just one row and the
> repeater items as cells? In this case you should use
>
> <HeaderTemplate>
> <table><tr>
> </HeaderTemplate>
>
> and
>
> <FooterTemplate>
> </tr></table>
> </FooterTemplate>
>
> Eliyahu
>
> <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) oups.com...
> > I would like to have multiple <td> in a repeater control. The below
> > code does not work:
> > <asp:Repeater ID="Repeater1" runat="server"
> > DataSourceID="SqlDataSource1" DataMember="DefaultView">
> > <HeaderTemplate>
> > <table>
> > </HeaderTemplate>
> > <tr>
> > <ItemTemplate>
> > <td>
> > <%#DataBinder.Eval(Container.DataItem, "itemname")%>
> > $<%#FormatNumber(DataBinder.Eval(Container.DataIte m, "itemprice"), 2)%>
> >
> > <img src="images/<%#DataBinder.Eval(Container.DataItem,
> > "picfilename")%>">
> > <%#DataBinder.Eval(Container.DataItem, "itemdescription")%>
> > <%#DataBinder.Eval(Container.DataItem, "itemaddtime")%>
> > </td>
> > </ItemTemplate>
> > </tr>
> > <FooterTemplate>
> > </table>
> > </FooterTemplate>
> > </asp:Repeater>
> >
> > The problem with the above is the <tr>, if I take that out then that
> > page works. However this does not produce the disired results. I would
> > like to have more than five <td> in a <tr>, essentially wrapping the
> > <ItemTemplate> tag with <tr> tags and only repeating the <ItemTemplate>
> > five times.
> >
> > Any help would be greatly appreciated,
> > Pete
> >


 
Reply With Quote
 
Eliyahu Goldin
Guest
Posts: n/a
 
      08-16-2005
Then you need a datalist rather than a repeater. You can set it up to show 5
items in a row. And you don't need to care about table tags yourself, it
will do it for you.

Eliyahu

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> That is almost what I was looking for. I would like to have every five
> records returned to be in their own set of <tr> tags so there would be
> more than one set of <tr> tags.
>
> Thanks again for your help,
> Pete
>
> Eliyahu Goldin wrote:
> > Pete,
> >
> > If I understand you correctly, you want to have just one row and the
> > repeater items as cells? In this case you should use
> >
> > <HeaderTemplate>
> > <table><tr>
> > </HeaderTemplate>
> >
> > and
> >
> > <FooterTemplate>
> > </tr></table>
> > </FooterTemplate>
> >
> > Eliyahu
> >
> > <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed) oups.com...
> > > I would like to have multiple <td> in a repeater control. The below
> > > code does not work:
> > > <asp:Repeater ID="Repeater1" runat="server"
> > > DataSourceID="SqlDataSource1" DataMember="DefaultView">
> > > <HeaderTemplate>
> > > <table>
> > > </HeaderTemplate>
> > > <tr>
> > > <ItemTemplate>
> > > <td>
> > > <%#DataBinder.Eval(Container.DataItem, "itemname")%>
> > > $<%#FormatNumber(DataBinder.Eval(Container.DataIte m, "itemprice"),

2)%>
> > >
> > > <img src="images/<%#DataBinder.Eval(Container.DataItem,
> > > "picfilename")%>">
> > > <%#DataBinder.Eval(Container.DataItem, "itemdescription")%>
> > > <%#DataBinder.Eval(Container.DataItem, "itemaddtime")%>
> > > </td>
> > > </ItemTemplate>
> > > </tr>
> > > <FooterTemplate>
> > > </table>
> > > </FooterTemplate>
> > > </asp:Repeater>
> > >
> > > The problem with the above is the <tr>, if I take that out then that
> > > page works. However this does not produce the disired results. I would
> > > like to have more than five <td> in a <tr>, essentially wrapping the
> > > <ItemTemplate> tag with <tr> tags and only repeating the

<ItemTemplate>
> > > five times.
> > >
> > > Any help would be greatly appreciated,
> > > Pete
> > >

>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Radio Button List in Repeater Control IFIA ASP .Net 0 03-07-2008 06:06 PM
User Control in Repeater fires multiple events. Dave A ASP .Net 1 01-10-2007 01:21 AM
Repeater inside a repeater....how? voidfill3d@yahoo.com ASP .Net 1 08-10-2005 01:58 PM
Repeater Using Javascript Referencing a Column in the Repeater rwoo_98@yahoo.com ASP .Net 0 02-26-2005 05:02 PM
Repeater control with nested repeater chris.reed@digus.com ASP .Net 0 02-11-2005 05:10 PM



Advertisments