473,326 Members | 2,128 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,326 software developers and data experts.

Nesting a repeater inside a table??

Hi

I'm fairly new to ASP.NET and realise I'm probably asking a very
straightforward question, sorry about that but I'd be grateful if
someone could possibly help out - I'm sure the answer will turn out to
be very easy!
I'm trying to basically do the following (in reality there is a lot
more code in between the table rows, such as the cells and their
contents, but I'm only posting the structure here as that's the
relavant bit):
<asp:Table>

<asp:TableRow>
</asp:TableRow>

<asp:TableRow>
</asp:TableRow>

<asp:TableRow>
</asp:TableRow>

<asp:Repeater ID="rep1" runat="server">
<ItemTemplate>
<asp:TableRow>
</asp:TableRow>
</ItemTemplate>
</asp:Repeater>

</asp:Table>
Unfortunately, the parser doesn't like the repeater being where it is
- however I definitely need to use a repeater here, as I've got some
other non-repeating stuff to include in the first few table rows (a
basic data grid with just one header row wouldn't even begin to
accommodate what I need for this). If anyone could suggest how I can
get the above code to compile I'd be very grateful!

Feb 28 '07 #1
3 5309
I think I MAY have found the answer...I believe I need to use the
Repeater's <headertemplatefof the non-repeating rows. Will post
again once I've tested this.

Feb 28 '07 #2
Hi again

A quick update...sadly that didn't work. I felt sure this would solve
my problem...
<asp:Repeater ID="rep1" runat="server">
<headertemplate>
<asp:Table>

<asp:TableRow>
</asp:TableRow>

<asp:TableRow>
</asp:TableRow>

<asp:TableRow>
</asp:TableRow>

</headertemplate>
<ItemTemplate>

<asp:TableRow>
</asp:TableRow>
</ItemTemplate>

<ItemTemplate>

<FooterTemplate>
</asp:Table>
</FooterTemplate>

</asp:Repeater>
....but I get the following error...
System.Web.UI.WebControls.TableRowCollection must have items of type
'System.Web.UI.WebControls.TableRow'. 'ItemTemplate' is of type
'System.Web.UI.HtmlControls.HtmlGenericControl'
I'll keep trying to solve this and report back with any progress!

Feb 28 '07 #3
Oops, ignore the last <ItemTemplateabove, I know that shouldn't be
there. Apologies.

Feb 28 '07 #4

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

Similar topics

0
by: Shun Duke | last post by:
I have working code allowing me to nest repeaters inside datalists using relations and child rows but this does not allow me to acheive my goal. What I want to be able to do is display small...
4
by: huzz | last post by:
I am trying to access a DropDownList control inside a repeater using ItemCommand as shown below but for some reason i can't access the DropDownList. When i step through the debug i get <undefine...
3
by: Leigh Webber | last post by:
I have an HTMLAnchor control on my aspx page. When it's not inside a repeater, it works fine. When I put it inside a repeater control, the handler never gets fired. I have a handler for the...
3
by: sorCrer | last post by:
Hi All, Posted after extensive searching! I have a nested repeater control as follows: (Simplified ;-)) <table> <asp:repeater id=parent onItemDataBound=createChild> <tr><td>Level...
0
by: Reza Nabi | last post by:
Dear All: Banckgroud: I have a datagrid which lives inside a repeater. Which is working fine. What i need is to dyanamically set the column width of the grid (which lieves inside the repeater)....
8
by: fernandezr | last post by:
I would like to use a user control as a template inside a repeater. Some of the fields in the control should be hidden depending on whether or not there is data. I'm still a ASP .Net newbie so the...
0
by: uncensored | last post by:
Hello everyone, I'm fairly new at .Net and I have a repeater inside a repeater problem. I will attach my code to this message but basically what I am able to tell when I run my page it tells me...
1
by: Smokey Grindle | last post by:
Is it possible to nest a repeater? I want to list a list of items, then inside each one of those items, put a list of its sub items so basically the parent repeater has a child repeater per row...
2
by: John Kotuby | last post by:
Hi all, I have a page that displays the contents of a business document in HTML that uses multiple select queries to provide the relevent data. There is a call to the parent table and then...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.