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")%>
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")%>