468,245 Members | 1,668 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,245 developers. It's quick & easy.

Nested Repeaters Question

Hello all,

Is it possible to share controls inside a child repeater? Here's the
situation: I have a web page that needs to display data grouped by A,
and alternatively by B (only one grouping displayed at a time through
Panel.Visible). A and B both share common child data: C. I have 2
parent repeaters corresponding to A and B, and each of those repeaters
have 1 child repeater containing child data C. Presently, my code
handles databinding on these repeaters just fine. However, there are
asp.net controls embedded inside the repeater items of the child
repeater (C). I'd like to have the page set up so that when the user
switches between viewing A and B, the controls in the child repeaters
share the same values. What's the best way to accomplish this?

The controls in the child repeater can be given the same "id"
attribute, but they still operate as separate controls. Also, I tried
to simply do away with B and its child, and have logic in the
OnItemDataBind event of the parent repeater display the information
corresponding to the currently-active view. The initial display
works, but when I re-bind the parent repeater, it of course destroys
the child repeater and its controls.

Any suggestions would be greatly appreciated!

Andy

Oct 30 '07 #1
1 1654
In case anyone encounters this issue, here's how I'm dealing with it:

When the user switches between the 2 views, I'm manually setting the
properties of the web controls of view B = properties of the web
controls of view A. I wrote a nasty method that has a FOR loop with 3
nested FOR loops to accomplish the property transfer. I was hoping
there would be an easier way (and I'm still not convinced that there
isn't), but this way works despite requiring some complicated code.
Cheers.

Andy

On Oct 30, 4:32 pm, andrew.dougla...@gmail.com wrote:
Hello all,

Is it possible to share controls inside a child repeater? Here's the
situation: I have a web page that needs to display data grouped by A,
and alternatively by B (only one grouping displayed at a time through
Panel.Visible). A and B both share common child data: C. I have 2
parent repeaters corresponding to A and B, and each of those repeaters
have 1 child repeater containing child data C. Presently, my code
handles databinding on these repeaters just fine. However, there are
asp.net controls embedded inside the repeater items of the child
repeater (C). I'd like to have the page set up so that when the user
switches between viewing A and B, the controls in the child repeaters
share the same values. What's the best way to accomplish this?

The controls in the child repeater can be given the same "id"
attribute, but they still operate as separate controls. Also, I tried
to simply do away with B and its child, and have logic in the
OnItemDataBind event of the parent repeater display the information
corresponding to the currently-active view. The initial display
works, but when I re-bind the parent repeater, it of course destroys
the child repeater and its controls.

Any suggestions would be greatly appreciated!

Andy

Oct 31 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Machi | last post: by
reply views Thread by kettch | last post: by
2 posts views Thread by Matt Jensen | last post: by
1 post views Thread by mavrick_101 | last post: by
4 posts views Thread by =?Utf-8?B?SmFtZXMgR2V1cnRz?= | last post: by
2 posts views Thread by Josh | last post: by
PrinsonG
1 post views Thread by PrinsonG | last post: by
3 posts views Thread by Leon Mayne | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.