Nested Repeaters Code Post

A

agrath

Hi All,

I found and used an example of a nested repeater I found in the group
but
1) converted it to asp.net vb
and
2) realised there was a small mistake in it, at least for my
implementation

I have posted the resulting code along with the original message in
case anyone needs it as a reference in the future.


Originally,
On Mon, Aug 11 2003 10:12pm Tony Wright ([email protected])
wrote
in microsoft.public.dotnet.csharp.general:
Newsgroups:
From: (e-mail address removed) (Tony Wright) - Find messages by
this
author
Date: 11 Aug 2003 22:12:42 -0700
Local: Mon, Aug 11 2003 10:12 pm
Subject: Accessing a parent field from within a child repeater control
...


In a follow up post, the solution was posted:

To access a parent field from within a child repeater control using
in-line
code:
<%#
DataBinder.Eval(((System.Web.UI.WebControls.RepeaterItem)Container.Parent.Parent.Parent).DataItem,
"parent_field") %>


Container.Parent.Parent.Parent refers to the Parent Repeater, not the
Repeater Item that is currently active, thus "Parent_Field" fails
(assuming there is a column by name of "Parent_Field" in your dataset)

I used the following code, after converting it to VB

<%#DataBinder.Eval(CType((Container.Parent.Parent),
System.Web.UI.WebControls.RepeaterItem).DataItem,
"Parent_Column_Name")%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top