|
-
Jun 15th, 2005, 05:47 PM
#1
Thread Starter
Hyperactive Member
Can you nest a datarepeater in a datarepeater
I have a table whose records I want to display in a highly formatted way. The datarepeater works great for this, have used it many times. I am in a scenario now however that requires me to not only display records from that table but sub records from a child table. I instantly thought, no problem Ill just nest another repeater. Come data binding time however I didn't know how to go about it since the child records are based on a index key that is not known until the first repeater runs. Anyone know a good way to do this?
-
Jun 16th, 2005, 03:48 AM
#2
Frenzied Member
Re: Can you nest a datarepeater in a datarepeater
What you need to do is execute the databind of the child repeater within the OnItemDataBound event of the parent repeater. Give a shout if you need more info.
DJ
If I have been helpful please rate my post. If I haven't tell me!
-
Jun 16th, 2005, 01:39 PM
#3
Thread Starter
Hyperactive Member
Re: Can you nest a datarepeater in a datarepeater
How do I declare and initialize the second datarepeater. I added the code for a second datarepeater in the event as described. But the code did not recognize it. So I tried adding it to the declaration list like this...
Protected WithEvents Repeater2 As System.Web.UI.WebControls.Repeater
This made the red lines go away in my code but when I compiled it and tried to run it I still got the following error on that line.
System.NullReferenceException: Object reference not set to an instance of an object.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|