Complex data binding to repeater control question.

D

Dot net work

Hello.

I have an interesting data binding scenario:

I have a repeater control. It repeats a typical custom web user
control.

I also have a collection object, and each collection element contains
various pieces of information inside a custom object, including an id
field.

This bit's quite easy: bind the collection object to the repeater, and
get each repeated web user control to display various data fields that
the collection object's elements contain.

The challenge is: I have a second collection object, and both
collection objects conveniently share the same id field for cross
checking purposes. I need the repeated web user controls to display
various data fields from *both* collections, and not just from one
collection, but I can only bind one collection to the repeater
control.

Any thoughts at all would be gratefully received...apart from "good
luck!" <g>

TIA,
-dnw.
 
D

Dot net work

I found a way to solve this problem.

Just take the id field from the first collection, and bind it to a
public property inside the web user control. Then, inside this web
user control's code behind class, you have access to this id field
(from the first collection), which you can then use to search for
objects inside the second collection, as the 2 collections are linked
together via the common id field.

-dnw.
 

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

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top