By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,784 Members | 2,933 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,784 IT Pros & Developers. It's quick & easy.

Nested Repeaters Question

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.