Nested Repeaters Question

A

andrew.douglas11

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
 
A

andrew.douglas11

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
 

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,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top