473,587 Members | 2,227 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Nested Repeater - 3 levels - datasource

I have extended the example at
http://support.microsoft.com/default.aspx?scid=kb;EN-
US;306154 to build a webform page with 3 layers of nested
Repeaters (ie. parent, child and grandchild).

I added a third DataTable to the DataSet, and created a
second Relation between the second and third DataTables.
On the aspx page I copied the child Repeater to create
the grandchild, referencing the second Relation.

It is throwing an InvalidCastExce ption when executing the
datasource of the innermost Repeater - <%# ((DataRowView)
Container.DataI tem).Row.GetChi ldRows
("childEvents_g randchildEvents ") %> - why does it not
like the cast to DataRowView?

Many thanks in advance.
Nov 17 '05 #1
2 5510
>I have extended the example at
http://support.microsoft.com/default.aspx?scid=kb;EN-
US;306154 to build a webform page with 3 layers of nested
Repeaters (ie. parent, child and grandchild).

I added a third DataTable to the DataSet, and created a
second Relation between the second and third DataTables.
On the aspx page I copied the child Repeater to create
the grandchild, referencing the second Relation.

It is throwing an InvalidCastExce ption when executing the
datasource of the innermost Repeater - <%# ((DataRowView)
Container.Data Item).Row.GetCh ildRows
("childEvents_ grandchildEvent s") %> - why does it not
like the cast to DataRowView?

Many thanks in advance.
.


The offending code is not displayed in the msdn view of
this posting so here it is again <code>((DataRow View)
Container.DataI tem).Row.GetChi ldRows
("childEvents_g randchildEvents ")</code> . . . it is the
cast to DataRowView on the innermost Repeater that
fails . . . what should the datasource for the grandchild
nested repeater be? I've found several posts on various
newsgroups and forums about this problem, but no answers -
surely there's a simple answer?
Nov 17 '05 #2
sinthetik
1 New Member
Did you manage to find a solution to this problem? I'm also having trouble figuring it out...
Jun 16 '06 #3

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

Similar topics

3
2704
by: Tommy | last post by:
I have been working on getting nested repeaters to work for several days. When I add a repeater inside my item template i cannot see it in my code and can't set the datasource for it, etc, thus it's useless. Anytime i try to reference rptChild I get an error saying that it's not an object. If I set a break point I see that it's <nothing>. ...
0
1755
by: mark | last post by:
My problem is I need to have a "nested" repeater. I have an array which I load into a hashtable - that part works great. I can setup the second repeater to work just fine, as long as it's not nested within the first repeater. If it is nested within the first repeater, I don't get any data. If I put the second repeater as a separate repeater,...
0
5392
by: Ed Allan | last post by:
http://ejaconsulting.com/nestedrepeater/NestedRepeater.txt >-----Original Message----- >Doh! The HTML has all been rendered . . . > >Right click on this link and select 'Save target as ..' >to get the code in a text file. > >Thanks - Ed >
2
3285
by: Stephen Miller | last post by:
I am using the OnItemDataBound event of Repeater control to nest a DataGrid within the Repeater. When I attempt to bind to the DataGrid using the DataSource method I get the error message "Object reference not set to an instance of an object". This error message commonly occurs when a server control is incorrecly declared, so naturally I have...
0
1260
by: kettch | last post by:
Is it possible to have nested repeaters three layers deep I have gotten it to work with only two, and when I tried to get the third layer to work COD <asp:repeater id="rep" runat="server"><ItemTemplate><span style="BACKGROUND-COLOR: silver"><%# DataBinder.Eval(Container.DataItem, "CustomerID") %>&nbsp <%#...
3
4032
by: Eirik Eldorsen | last post by:
Im trying to make a nested repeater with 3 levels. I've successfully created a nested repeater with 2 levels, but when adding the 3rd level I get an InvalidCastException. What am I doing wrong? Here is my code: <asp:Repeater id="level1Repeater" runat="server"> <itemtemplate>
2
1902
by: mark | last post by:
(not sure if this is the correct group) My problem is I need to have a "nested" repeater. I have an array which I load into a hashtable - that part works great. I can setup the second repeater to work just fine, as long as it's not nested within the first repeater. If it is nested within the first repeater, I don't get any data. If I put...
4
4555
by: =?Utf-8?B?SmFtZXMgR2V1cnRz?= | last post by:
On my page, I have one repeater that contains a literal control and a nested repeater. The nested repeater contains a literal control. Both repeaters are databound with only one object (string). But... and this is the crappy part, the nested repeater's events are fired twice. How do I know this? I setup global private counter variables...
0
1735
by: Adam Knight | last post by:
Hi All, I have a repeater control nested inside another repeater control. The nested (child) repeater control, is bound to an object data source. My problem is, i need to send a data item value from the 'item' of parent control as a parameter to the object datasource of the child repeater control. Any thoughts on how to best do this?...
0
7915
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8205
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8339
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8220
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6619
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.